http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57861
Bug ID: 57861 Summary: wrong code at -O3 on x86_64-linux-gnu in 32-bit mode Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The current gcc trunk produces wrong code for the following testcase on x86_64-linux when compiled at -O3 in 32-bit mode. This is a regression from 4.8.x. $ gcc-trunk -v gcc version 4.9.0 20130708 (experimental) [trunk revision 200751] (GCC) $ gcc-trunk -m32 -O3 reduced.c $ a.out 1 $ gcc-trunk -m32 -O2 reduced.c $ a.out 0 $ gcc-4.8 -m32 -O3 reduced.c $ a.out 0 $ ---------------------------------------------------- int printf (const char *, ...); short a = 1, f; int b, c, d, *g = &b, h, i, j; unsigned int e; static int foo (char p) { int k; for (c = 0; c < 2; c++) { i = (j = 0) || p; k = i * p; if (e < k) { short *l = &f; a = d && h; *l = 0; } } return 0; } int main () { *g = foo (a); printf ("%d\n", a); return 0; }