diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106768.patch')
-rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106768.patch | 182 |
1 files changed, 0 insertions, 182 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106768.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106768.patch deleted file mode 100644 index f1f7718eb5..0000000000 --- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106768.patch +++ /dev/null | |||
@@ -1,182 +0,0 @@ | |||
1 | 2011-07-07 Richard Sandiford <richard.sandiford@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | * builtins.c (get_object_alignment): Fix comment. | ||
5 | * fold-const.c (get_pointer_modulus_and_residue): Remove | ||
6 | allow_func_align. Use get_object_alignment. | ||
7 | (fold_binary_loc): Update caller. | ||
8 | |||
9 | 2011-07-07 Richard Sandiford <richard.sandiford@linaro.org> | ||
10 | |||
11 | gcc/ | ||
12 | Backport from mainline: | ||
13 | |||
14 | 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org> | ||
15 | |||
16 | PR tree-optimization/49545 | ||
17 | * builtins.c (get_object_alignment_1): Update function comment. | ||
18 | Do not use DECL_ALIGN for functions, but test | ||
19 | TARGET_PTRMEMFUNC_VBIT_LOCATION instead. | ||
20 | * fold-const.c (get_pointer_modulus_and_residue): Don't check | ||
21 | for functions here. | ||
22 | * tree-ssa-ccp.c (get_value_from_alignment): Likewise. | ||
23 | |||
24 | gcc/testsuite/ | ||
25 | Backport from mainline: | ||
26 | |||
27 | 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org> | ||
28 | |||
29 | * gcc.dg/torture/pr49169.c: Restrict to ARM and MIPS targets. | ||
30 | |||
31 | 2011-07-07 Richard Sandiford <richard.sandiford@linaro.org> | ||
32 | |||
33 | gcc/ | ||
34 | Backport from mainline: | ||
35 | |||
36 | 2011-07-27 Richard Guenther <rguenther@suse.de> | ||
37 | |||
38 | PR tree-optimization/49169 | ||
39 | * fold-const.c (get_pointer_modulus_and_residue): Don't rely on | ||
40 | the alignment of function decls. | ||
41 | |||
42 | gcc/testsuite/ | ||
43 | Backport from mainline: | ||
44 | |||
45 | 2011-07-27 Michael Hope <michael.hope@linaro.org> | ||
46 | Richard Sandiford <richard.sandiford@linaro.org> | ||
47 | |||
48 | PR tree-optimization/49169 | ||
49 | * gcc.dg/torture/pr49169.c: New test. | ||
50 | |||
51 | === modified file 'gcc/builtins.c' | ||
52 | --- old/gcc/builtins.c 2011-03-03 21:56:58 +0000 | ||
53 | +++ new/gcc/builtins.c 2011-07-04 09:52:27 +0000 | ||
54 | @@ -264,7 +264,14 @@ | ||
55 | } | ||
56 | |||
57 | /* Return the alignment in bits of EXP, an object. | ||
58 | - Don't return more than MAX_ALIGN no matter what. */ | ||
59 | + Don't return more than MAX_ALIGN no matter what. | ||
60 | + | ||
61 | + Note that the address (and thus the alignment) computed here is based | ||
62 | + on the address to which a symbol resolves, whereas DECL_ALIGN is based | ||
63 | + on the address at which an object is actually located. These two | ||
64 | + addresses are not always the same. For example, on ARM targets, | ||
65 | + the address &foo of a Thumb function foo() has the lowest bit set, | ||
66 | + whereas foo() itself starts on an even address. */ | ||
67 | |||
68 | unsigned int | ||
69 | get_object_alignment (tree exp, unsigned int max_align) | ||
70 | @@ -286,7 +293,21 @@ | ||
71 | exp = DECL_INITIAL (exp); | ||
72 | if (DECL_P (exp) | ||
73 | && TREE_CODE (exp) != LABEL_DECL) | ||
74 | - align = DECL_ALIGN (exp); | ||
75 | + { | ||
76 | + if (TREE_CODE (exp) == FUNCTION_DECL) | ||
77 | + { | ||
78 | + /* Function addresses can encode extra information besides their | ||
79 | + alignment. However, if TARGET_PTRMEMFUNC_VBIT_LOCATION | ||
80 | + allows the low bit to be used as a virtual bit, we know | ||
81 | + that the address itself must be 2-byte aligned. */ | ||
82 | + if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn) | ||
83 | + align = 2 * BITS_PER_UNIT; | ||
84 | + else | ||
85 | + align = BITS_PER_UNIT; | ||
86 | + } | ||
87 | + else | ||
88 | + align = DECL_ALIGN (exp); | ||
89 | + } | ||
90 | else if (CONSTANT_CLASS_P (exp)) | ||
91 | { | ||
92 | align = TYPE_ALIGN (TREE_TYPE (exp)); | ||
93 | |||
94 | === modified file 'gcc/fold-const.c' | ||
95 | --- old/gcc/fold-const.c 2011-05-23 20:37:18 +0000 | ||
96 | +++ new/gcc/fold-const.c 2011-07-04 09:52:27 +0000 | ||
97 | @@ -9232,15 +9232,10 @@ | ||
98 | 0 <= N < M as is common. In general, the precise value of P is unknown. | ||
99 | M is chosen as large as possible such that constant N can be determined. | ||
100 | |||
101 | - Returns M and sets *RESIDUE to N. | ||
102 | - | ||
103 | - If ALLOW_FUNC_ALIGN is true, do take functions' DECL_ALIGN_UNIT into | ||
104 | - account. This is not always possible due to PR 35705. | ||
105 | - */ | ||
106 | + Returns M and sets *RESIDUE to N. */ | ||
107 | |||
108 | static unsigned HOST_WIDE_INT | ||
109 | -get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue, | ||
110 | - bool allow_func_align) | ||
111 | +get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue) | ||
112 | { | ||
113 | enum tree_code code; | ||
114 | |||
115 | @@ -9270,9 +9265,8 @@ | ||
116 | } | ||
117 | } | ||
118 | |||
119 | - if (DECL_P (expr) | ||
120 | - && (allow_func_align || TREE_CODE (expr) != FUNCTION_DECL)) | ||
121 | - return DECL_ALIGN_UNIT (expr); | ||
122 | + if (DECL_P (expr)) | ||
123 | + return get_object_alignment (expr, ~0U) / BITS_PER_UNIT; | ||
124 | } | ||
125 | else if (code == POINTER_PLUS_EXPR) | ||
126 | { | ||
127 | @@ -9282,8 +9276,7 @@ | ||
128 | |||
129 | op0 = TREE_OPERAND (expr, 0); | ||
130 | STRIP_NOPS (op0); | ||
131 | - modulus = get_pointer_modulus_and_residue (op0, residue, | ||
132 | - allow_func_align); | ||
133 | + modulus = get_pointer_modulus_and_residue (op0, residue); | ||
134 | |||
135 | op1 = TREE_OPERAND (expr, 1); | ||
136 | STRIP_NOPS (op1); | ||
137 | @@ -11163,8 +11156,7 @@ | ||
138 | unsigned HOST_WIDE_INT modulus, residue; | ||
139 | unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg1); | ||
140 | |||
141 | - modulus = get_pointer_modulus_and_residue (arg0, &residue, | ||
142 | - integer_onep (arg1)); | ||
143 | + modulus = get_pointer_modulus_and_residue (arg0, &residue); | ||
144 | |||
145 | /* This works because modulus is a power of 2. If this weren't the | ||
146 | case, we'd have to replace it by its greatest power-of-2 | ||
147 | |||
148 | === added file 'gcc/testsuite/gcc.dg/torture/pr49169.c' | ||
149 | --- old/gcc/testsuite/gcc.dg/torture/pr49169.c 1970-01-01 00:00:00 +0000 | ||
150 | +++ new/gcc/testsuite/gcc.dg/torture/pr49169.c 2011-06-29 09:46:06 +0000 | ||
151 | @@ -0,0 +1,15 @@ | ||
152 | +/* { dg-do compile { target { arm*-*-* || mips*-*-* } } } */ | ||
153 | + | ||
154 | +#include <stdlib.h> | ||
155 | +#include <stdint.h> | ||
156 | + | ||
157 | +int | ||
158 | +main (void) | ||
159 | +{ | ||
160 | + void *p = main; | ||
161 | + if ((intptr_t) p & 1) | ||
162 | + abort (); | ||
163 | + return 0; | ||
164 | +} | ||
165 | + | ||
166 | +/* { dg-final { scan-assembler "abort" } } */ | ||
167 | |||
168 | === modified file 'gcc/tree-ssa-ccp.c' | ||
169 | --- old/gcc/tree-ssa-ccp.c 2011-05-05 15:42:22 +0000 | ||
170 | +++ new/gcc/tree-ssa-ccp.c 2011-06-29 09:46:06 +0000 | ||
171 | @@ -522,10 +522,6 @@ | ||
172 | val = bit_value_binop (PLUS_EXPR, TREE_TYPE (expr), | ||
173 | TREE_OPERAND (base, 0), TREE_OPERAND (base, 1)); | ||
174 | else if (base | ||
175 | - /* ??? While function decls have DECL_ALIGN their addresses | ||
176 | - may encode extra information in the lower bits on some | ||
177 | - targets (PR47239). Simply punt for function decls for now. */ | ||
178 | - && TREE_CODE (base) != FUNCTION_DECL | ||
179 | && ((align = get_object_alignment (base, BIGGEST_ALIGNMENT)) | ||
180 | > BITS_PER_UNIT)) | ||
181 | { | ||
182 | |||