Created attachment 22505 [details] Preprocessed Linux source file (in bzip2 format) Compile with: gcc -m32 -msoft-float -mregparm=3 -mpreferred-stack-boundary=2 -fno-strict-aliasing -fno-common -fno-delete-null-pointer-checks -freg-struct-return -ffreestanding -fno-asynchronous-unwind-tables -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-overflow -fconserve-stack -Os tcp_input.i
Created attachment 22506 [details] Backtrace in GDB
Reducing...
Reduced testcase, fails on x86_64-linux with -m32 and -O{2,s} {,-fno-strict-aliasing}. Looking into it... struct S { unsigned s[5]; } *p; void foo (int x) { int a = x == 1 ? 4 : 1; asm ("" : "+m" (p->s[a])); *(unsigned *) p += 1; }
Created attachment 22510 [details] gcc46-pr46637.patch Untested fix.
Author: jakub Date: Thu Nov 25 18:00:47 2010 New Revision: 167148 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167148 Log: PR middle-end/46637 * combine.c (try_combine): When substing i2dest for i2src, pass 1 as last argument even if i0_feeds_i1_n && i1_feeds_i2_n && i0dest_in_i0src. * gcc.c-torture/compile/pr46637.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr46637.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/testsuite/ChangeLog
Fixed.