This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/45722] [4.6 Regression] FAIL: gcc.c-torture/execute/20040709-2.c execution at -O1 and -Os
- From: "dave at hiauly1 dot hia.nrc.ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 9 Oct 2010 20:47:12 +0000
- Subject: [Bug middle-end/45722] [4.6 Regression] FAIL: gcc.c-torture/execute/20040709-2.c execution at -O1 and -Os
- Auto-submitted: auto-generated
- References: <bug-45722-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45722
--- Comment #7 from dave at hiauly1 dot hia.nrc.ca 2010-10-09 20:46:50 UTC ---
Took another at this bug. At least at -O1 with r165177, the nature
of the FAIL seems to have changed. The testcase now fails in testB
with a segmentation fault caused by a misaligned load.
Program received signal SIGBUS, Bus error.
0x00002d90 in testB () at pr45722.c:48
48 x = sB;
(gdb) disass 0x00002d80,0x00002da0
Dump of assembler code from 0x2d80 to 0x2da0:
0x00002d80 <testB+152>: ldb,ma 1(r31),r21
0x00002d84 <testB+156>: stb,ma r20,1(r22)
0x00002d88 <testB+160>: addib,>= -2,r19,0x2d7c <testB+148>
0x00002d8c <testB+164>: stb,ma r21,1(r22)
=> 0x00002d90 <testB+168>: ldw 2(r4),r4
0x00002d94 <testB+172>: b,l 0x2c80 <fn3B>,rp
0x00002d98 <testB+176>: copy r5,r26
0x00002d9c <testB+180>: ldb 50(r3),r20
(gdb) p &sB
$1 = (struct B *) 0x40001a50
(gdb) p/x $r4
$2 = 0x40001a50
It appears the load for sB.l is not expanded correctly given that the
struct is packed:
;; x$l_3 = MEM[(struct B *)&sB + 2B];
(insn 106 105 107 (set (reg/f:SI 205)
(high:SI (symbol_ref:SI ("sB") [flags 0x200] <var_decl 7afa7f00 sB>)))
pr45722.c:48 -1
(nil))
(insn 107 106 108 (set (reg/f:SI 204)
(lo_sum:SI (reg/f:SI 205)
(symbol_ref:SI ("sB") [flags 0x200] <var_decl 7afa7f00 sB>)))
pr45722.c:48 -1
(expr_list:REG_EQUAL (symbol_ref:SI ("sB") [flags 0x200] <var_decl
7afa7f00 sB>)
(nil)))
(insn 108 107 109 (set (reg/f:SI 206)
(plus:SI (reg/f:SI 204)
(const_int 0 [0]))) pr45722.c:48 -1
(nil))
(insn 109 108 0 (set (reg:SI 142 [ x$l ])
(mem/c:SI (plus:SI (reg/f:SI 206)
(const_int 2 [0x2])) [0 MEM[(struct B *)&sB + 2B]+0 S4 A8]))
pr5722.c:48 -1
(nil))
;; r_16 = fn3B (a_13);
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)