Merge lp:~rsandifo/gcc-linaro/lp721531-4.5 into lp:gcc-linaro/4.5

Proposed by Richard Sandiford
Status: Merged
Approved by: Ramana Radhakrishnan
Approved revision: no longer in the source branch.
Merged at revision: 99521
Proposed branch: lp:~rsandifo/gcc-linaro/lp721531-4.5
Merge into: lp:gcc-linaro/4.5
Diff against target: 183 lines (+96/-16) (has conflicts)
4 files modified
ChangeLog.linaro (+52/-0)
gcc/builtins.c (+23/-2)
gcc/fold-const.c (+6/-14)
gcc/testsuite/gcc.dg/torture/pr49169.c (+15/-0)
Text conflict in ChangeLog.linaro
To merge this branch: bzr merge lp:~rsandifo/gcc-linaro/lp721531-4.5
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+66765@code.launchpad.net

This proposal supersedes a proposal from 2011-06-29.

Description of the change

This version includes some branch-local changes to account
for differences in the handling of PR 35705. In mainline,
get_pointer_and_residue reuses get_object_alignment,
but that improvement isn't in 4.6 and earlier. This backport
just reuses get_object_alignment for the simple and safe*
case of DECLs.

(PR 35705 was about optimising away checks for bit 1 (rather than bit 0)
in a HPPA function address. This patch subsumes that one.

To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r99486 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5
cbuild-ancestor: lp:gcc-linaro+bzr99485
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild successfully built this on i686-lucid-cbuild137-scorpius-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5/logs/i686-lucid-cbuild137-scorpius-i686r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +PASS: gcc.dg/torture/pr49169.c -O0 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O1 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -flto (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -fwhopr (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -g (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -Os (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 -PASS: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0
 +FAIL: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5/logs/i686-lucid-cbuild137-scorpius-i686r1/gcc-testsuite.txt

cbuild-checked: i686-lucid-cbuild137-scorpius-i686r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild successfully built this on x86_64-natty-cbuild136-crucis-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild136-crucis-x86_64r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +PASS: gcc.dg/torture/pr49169.c -O0 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O1 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -flto (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -fwhopr (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -g (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -Os (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 -PASS: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0
 +FAIL: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99486~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild136-crucis-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild136-crucis-x86_64r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r99487 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5
cbuild-ancestor: lp:gcc-linaro+bzr99485
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild successfully built this on i686-lucid-cbuild142-scorpius-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/i686-lucid-cbuild142-scorpius-i686r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O0
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O1
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -flto
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -fwhopr
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -g
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -Os

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/i686-lucid-cbuild142-scorpius-i686r1/gcc-testsuite.txt

cbuild-checked: i686-lucid-cbuild142-scorpius-i686r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild successfully built this on x86_64-natty-cbuild144-oort1-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild144-oort1-x86_64r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O0
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O1
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -flto
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -fwhopr
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -g
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -Os

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild144-oort1-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild144-oort1-x86_64r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild successfully built this on armv7l-natty-cbuild144-ursa4-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild144-ursa4-armv5r2

The test suite was not checked as the branch point lp:gcc-linaro+bzr99485 has nothing to compare against.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99487~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild144-ursa4-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild144-ursa4-armv5r2

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r99488 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5
cbuild-ancestor: lp:gcc-linaro+bzr99485
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-natty-cbuild148-oort1-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild148-oort1-x86_64r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O0
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O1
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -flto
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O2 -fwhopr
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -O3 -g
 +UNSUPPORTED: gcc.dg/torture/pr49169.c -Os

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/x86_64-natty-cbuild148-oort1-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild148-oort1-x86_64r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild148-ursa1-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild148-ursa1-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99485:
 +PASS: gcc.dg/torture/pr49169.c -O0 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O1 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -flto (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 -fwhopr (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O2 (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -fomit-frame-pointer (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -O3 -g (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c -Os (test for excess errors)
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort
 +PASS: gcc.dg/torture/pr49169.c scan-assembler abort

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild148-ursa1-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild148-ursa1-cortexa9r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild149-ursa2-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild149-ursa2-armv5r2

The test suite was not checked as the branch point lp:gcc-linaro+bzr99485 has nothing to compare against.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99488~rsandifo~lp721531-4.5/logs/armv7l-natty-cbuild149-ursa2-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild149-ursa2-armv5r2

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

This is OK.

Ramana

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-07-01 11:24:39 +0000
3+++ ChangeLog.linaro 2011-07-04 10:22:21 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 2011-07-01 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
7
8 Backport from mainline.
9@@ -525,6 +526,57 @@
10 * function.c (prepare_shrink_wrap): New function.
11 (thread_prologue_and_epilogue_insns): Call it.
12
13+=======
14+2011-07-04 Richard Sandiford <rdsandiford@googlemail.com>
15+
16+ gcc/
17+ * builtins.c (get_object_alignment): Fix comment.
18+ * fold-const.c (get_pointer_modulus_and_residue): Remove
19+ allow_func_align. Use get_object_alignment.
20+ (fold_binary_loc): Update caller.
21+
22+2011-06-29 Richard Sandiford <rdsandiford@googlemail.com>
23+
24+ gcc/
25+ Backport from mainline:
26+
27+ 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org>
28+
29+ PR tree-optimization/49545
30+ * builtins.c (get_object_alignment_1): Update function comment.
31+ Do not use DECL_ALIGN for functions, but test
32+ TARGET_PTRMEMFUNC_VBIT_LOCATION instead.
33+ * fold-const.c (get_pointer_modulus_and_residue): Don't check
34+ for functions here.
35+
36+ gcc/testsuite/
37+ Backport from mainline:
38+
39+ 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org>
40+
41+ * gcc.dg/torture/pr49169.c: Restrict to ARM and MIPS targets.
42+
43+2011-06-27 Richard Sandiford <richard.sandiford@linaro.org>
44+
45+ gcc/
46+ Backport from mainline:
47+
48+ 2011-07-27 Richard Guenther <rguenther@suse.de>
49+
50+ PR tree-optimization/49169
51+ * fold-const.c (get_pointer_modulus_and_residue): Don't rely on
52+ the alignment of function decls.
53+
54+ gcc/testsuite/
55+ Backport from mainline:
56+
57+ 2011-07-27 Michael Hope <michael.hope@linaro.org>
58+ Richard Sandiford <richard.sandiford@linaro.org>
59+
60+ PR tree-optimization/49169
61+ * gcc.dg/torture/pr49169.c: New test.
62+
63+>>>>>>> MERGE-SOURCE
64 2011-03-03 Andrew Stubbs <ams@codesourcery.com>
65
66 gcc/
67
68=== modified file 'gcc/builtins.c'
69--- gcc/builtins.c 2011-01-06 11:02:44 +0000
70+++ gcc/builtins.c 2011-07-04 10:22:21 +0000
71@@ -263,7 +263,14 @@
72
73 /* Return the alignment in bits of EXP, an object.
74 Don't return more than MAX_ALIGN no matter what, ALIGN is the inital
75- guessed alignment e.g. from type alignment. */
76+ guessed alignment e.g. from type alignment.
77+
78+ Note that the address (and thus the alignment) computed here is based
79+ on the address to which a symbol resolves, whereas DECL_ALIGN is based
80+ on the address at which an object is actually located. These two
81+ addresses are not always the same. For example, on ARM targets,
82+ the address &foo of a Thumb function foo() has the lowest bit set,
83+ whereas foo() itself starts on an even address. */
84
85 int
86 get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
87@@ -327,7 +334,21 @@
88 exp = DECL_INITIAL (exp);
89 if (DECL_P (exp)
90 && TREE_CODE (exp) != LABEL_DECL)
91- align = MIN (inner, DECL_ALIGN (exp));
92+ {
93+ if (TREE_CODE (exp) == FUNCTION_DECL)
94+ {
95+ /* Function addresses can encode extra information besides their
96+ alignment. However, if TARGET_PTRMEMFUNC_VBIT_LOCATION
97+ allows the low bit to be used as a virtual bit, we know
98+ that the address itself must be 2-byte aligned. */
99+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)
100+ align = 2 * BITS_PER_UNIT;
101+ else
102+ align = BITS_PER_UNIT;
103+ }
104+ else
105+ align = MIN (inner, DECL_ALIGN (exp));
106+ }
107 #ifdef CONSTANT_ALIGNMENT
108 else if (CONSTANT_CLASS_P (exp))
109 align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
110
111=== modified file 'gcc/fold-const.c'
112--- gcc/fold-const.c 2011-05-05 14:28:53 +0000
113+++ gcc/fold-const.c 2011-07-04 10:22:21 +0000
114@@ -10030,15 +10030,10 @@
115 0 <= N < M as is common. In general, the precise value of P is unknown.
116 M is chosen as large as possible such that constant N can be determined.
117
118- Returns M and sets *RESIDUE to N.
119-
120- If ALLOW_FUNC_ALIGN is true, do take functions' DECL_ALIGN_UNIT into
121- account. This is not always possible due to PR 35705.
122- */
123+ Returns M and sets *RESIDUE to N. */
124
125 static unsigned HOST_WIDE_INT
126-get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue,
127- bool allow_func_align)
128+get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue)
129 {
130 enum tree_code code;
131
132@@ -10068,9 +10063,8 @@
133 }
134 }
135
136- if (DECL_P (expr)
137- && (allow_func_align || TREE_CODE (expr) != FUNCTION_DECL))
138- return DECL_ALIGN_UNIT (expr);
139+ if (DECL_P (expr))
140+ return get_object_alignment (expr, BITS_PER_UNIT, ~0U) / BITS_PER_UNIT;
141 }
142 else if (code == POINTER_PLUS_EXPR)
143 {
144@@ -10080,8 +10074,7 @@
145
146 op0 = TREE_OPERAND (expr, 0);
147 STRIP_NOPS (op0);
148- modulus = get_pointer_modulus_and_residue (op0, residue,
149- allow_func_align);
150+ modulus = get_pointer_modulus_and_residue (op0, residue);
151
152 op1 = TREE_OPERAND (expr, 1);
153 STRIP_NOPS (op1);
154@@ -11801,8 +11794,7 @@
155 unsigned HOST_WIDE_INT modulus, residue;
156 unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg1);
157
158- modulus = get_pointer_modulus_and_residue (arg0, &residue,
159- integer_onep (arg1));
160+ modulus = get_pointer_modulus_and_residue (arg0, &residue);
161
162 /* This works because modulus is a power of 2. If this weren't the
163 case, we'd have to replace it by its greatest power-of-2
164
165=== added file 'gcc/testsuite/gcc.dg/torture/pr49169.c'
166--- gcc/testsuite/gcc.dg/torture/pr49169.c 1970-01-01 00:00:00 +0000
167+++ gcc/testsuite/gcc.dg/torture/pr49169.c 2011-07-04 10:22:21 +0000
168@@ -0,0 +1,15 @@
169+/* { dg-do compile { target { arm*-*-* || mips*-*-* } } } */
170+
171+#include <stdlib.h>
172+#include <stdint.h>
173+
174+int
175+main (void)
176+{
177+ void *p = main;
178+ if ((intptr_t) p & 1)
179+ abort ();
180+ return 0;
181+}
182+
183+/* { dg-final { scan-assembler "abort" } } */

Subscribers

People subscribed via source and target branches