With -fipa-pta in flags, pta-field-2.c FAILs: FAIL: gcc.c-torture/execute/pta-field-2.c execution, -O2 FAIL: gcc.c-torture/execute/pta-field-2.c execution, -O3 -fomit-frame-pointer FAIL: gcc.c-torture/execute/pta-field-2.c execution, -O3 -g FAIL: gcc.c-torture/execute/pta-field-2.c execution, -Os FAIL: gcc.c-torture/execute/pta-field-2.c execution, -O2 -flto Command line: $ gcc -O2 -fipa-pta pta-field-2.i $ ./a.out Aborted The code might be undefined, but even -fno-strict-aliasing doesn't help: $ gcc -O2 -fipa-pta pta-field-2.i -fno-strict-aliasing $ ./a.out Aborted Tested revisions: r162653 - fail r161659 - fail r161170 - OK
Confirmed, mine. We generate wrong constraints for bar (int * * x) { int * D.2737; <bb 2>: D.2737_3 = MEM[(struct Foo *)x_1(D) + -8B].p; *D.2737_3 = 0; return; } Generating constraints for bar (bar) bar.arg0 = &NONLOCAL D.2737_3 = *bar.arg0 bar.use = bar.arg0 bar.clobber = D.2737_3 I have a patch.
Subject: Bug 45120 Author: rguenth Date: Thu Jul 29 12:30:09 2010 New Revision: 162676 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162676 Log: 2010-07-29 Richard Guenther <rguenther@suse.de> PR tree-optimization/45120 * tree-ssa-structalias.c (get_constraint_for_component_ref): Handle offset in DEREFs properly. (get_constraint_for_1): Handle MEM_REF offset properly. * gcc.dg/ipa/ipa-pta-15.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/ipa/ipa-pta-15.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-structalias.c
Fixed.