struct Bar { int p; }; struct Foo { struct Bar *p; }; int foo(struct Foo *f) { f->p->p = 1; bar(f); return f->p->p; }
.alias1: # VUSE <SMT.4_6>; D.1528_2 = f_1->p; # SMT.5_8 = V_MAY_DEF <SMT.5_7>; D.1528_2->p = 1; # .GLOBAL_VAR_10 = V_MAY_DEF <.GLOBAL_VAR_9>; bar (f_1); # VUSE <SMT.4_6>; D.1528_3 = f_1->p; # VUSE <SMT.5_8>; D.1529_4 = D.1528_3->p; return D.1529_4; and fre then does: # VUSE <SMT.4_6>; D.1528_2 = f_1->p; # SMT.5_8 = V_MAY_DEF <SMT.5_7>; D.1528_2->p = 1; # .GLOBAL_VAR_10 = V_MAY_DEF <.GLOBAL_VAR_9>; bar (f_1); D.1528_3 = D.1528_2; # VUSE <SMT.5_8>; D.1529_4 = D.1528_3->p; return D.1529_4; miscompiles kde4. -- Summary: [4.2 Regression] Wrong aliasing with global var grouping during call clobbering Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: wrong-code, alias Severity: blocker Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28410