On Linux/x86, revision 142072 gave: Executing on host: /export/gnu/import/svn/gcc-test/bld/gcc/xgcc -B/export/gnu/import/svn/gcc-test/bld/gcc/ -O3 -fomit-frame-pointer -funroll-loops -w -c -m32 -o 20080806-1.o /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/gcc.c-torture/compile/20080806-1.c (timeout = 300) /tmp/ccuL0Iug.s: Assembler messages:^M /tmp/ccuL0Iug.s:9: Warning: 65544 shortened to 8^M +FAIL: gcc.c-torture/compile/20080806-1.c -O3 -fomit-frame-pointer (test for excess errors) +FAIL: gcc.c-torture/compile/20080806-1.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (test for excess errors) +FAIL: gcc.c-torture/compile/20080806-1.c -O3 -fomit-frame-pointer -funroll-loops (test for excess errors) Revision 142058 is OK.
Revision 142061 is bad.
Revision 142061: http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01051.html is the cause.
Just the cause that the optimized dump looks differently, but is not wrong. The bug happens during reload's register elimination. (insn:HI 6 5 7 2 20080806-1.c:16 (parallel [ (set (reg:HI 58 [ pretmp.42 ]) (plus:HI (subreg:HI (reg/f:SI 20 frame) 0) (const_int 136 [0x88]))) (clobber (reg:CC 17 flags)) ]) 293 {*addhi_1_lea} (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) is reloaded into: (insn 47 5 6 2 20080806-1.c:16 (set (reg:HI 1 dx [orig:58 pretmp.42 ] [58]) (reg:HI 7 sp)) 53 {*movhi_1} (nil)) (insn:HI 6 47 7 2 20080806-1.c:16 (parallel [ (set (reg:HI 1 dx [orig:58 pretmp.42 ] [58]) (plus:HI (reg:HI 1 dx [orig:58 pretmp.42 ] [58]) (const_int 65544 [0x10008]))) (clobber (reg:CC 17 flags)) ]) 293 {*addhi_1_lea} (expr_list:REG_EQUIV (plus:HI (subreg:HI (plus:SI (reg/f:SI 7 sp) (const_int 65408 [0xff80])) 0) (const_int 136 [0x88])) (nil))) eliminate_regs_in_insn calls plus_constant with to_rtx (subreg:HI (reg/f:SI 7 sp) 0) and offset 0x10008. I guess it is eliminate_regs_in_insn and not plus_constant responsibility to trunc_int_for_mode this.
Created attachment 16731 [details] gcc44-pr38208.patch I'll test the attached patch. Related to PR29599.
Subject: Bug 38208 Author: jakub Date: Fri Nov 21 13:47:05 2008 New Revision: 142088 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142088 Log: PR target/38208 * reload1.c (eliminate_regs_in_insn): For trunc_int_for_mode use mode of PLUS, not mode of the eliminated register. Modified: trunk/gcc/ChangeLog trunk/gcc/reload1.c
Fixed.