At first I thought this was not a generic issue but I noticed it in generic places that did not have any aliasing issues. An example is the following program should not have any loop in it: struct BUF1 { int b1; int b12; };
void link_error(); int foo(int n, int * p) { int i = 0; for (i = 0; i < 1024*1024; i++) { p[0] = 1; } if (p[0] != 1) link_error (); return 0; } GNU C (GCC) version 4.4.0 20080304 (experimental) [trunk revision 132852] (i386-apple-darwin8.10.1) Worked but: GNU C (GCC) version 4.4.0 20080510 (experimental) [trunk revision 135142] (i386-apple-darwin8.11.1) does not. -- Summary: [4.4 Regression] missed store sinking out of a loop Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36204