#define N 256 struct { int x; int y; } S[100];
int z[100]; int foo (int y) { int x; S[5].x = 4; S[5].y = 0; x = S[5].x; return (x); } On powerpc64-linux, r130275 with -O2 we get: (taken from .store_ccp dump file) foo (y) { int x; <bb 2>: S[5].x = 4; S[5].y = 0; x_1 = S[5].x; return x_1; } [A patch was submitted (http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01901.html) which is no longer relevant because of -http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01370.html.] -- Summary: Missed store ccp optimization Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: eres at il dot ibm dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34172