------- Comment #29 from jakub at gcc dot gnu dot org 2007-09-11 19:52 ------- The new testcases show further problems. I believe that for ARRAY_TYPE fields we need to mark the type of its fields (recursively down), using close_type_seen like we already do for records and unions. On the other side, get_canon_type_uid in ipa_type_escape_field_does_not_clobber_p going through POINTER_TYPEs to what they point to seems wrong. This is what I have in pr33136-4.c - I can't understand why the fact that something took address of an int field has any influence on int * fields - if nothing took address of an int * field, then how could it alias with what int ** pointer points to?
Could anyone with access to SPEC see what is the difference between -O2 vs. -O2 -fno-ipa-type-escape (or -O3 vs. -O3 -fno-ipa-type-escape) on 4.1 and/or 4.2 branches? For those I think the safest fix is just disable this optimization altogether, in many cases it gives wrong answers. 4.1 miscompiles at -O2 just 20070824-1.c and pr33136-5.c (and the bugs go away with -O2 -fno-ipa-type-escape), while gcc 4.2 is much worse, all of 20070824-1.c and pr33136-{1,3,5}.c are miscompiled at -O2, and all the pr33136-{1,3,5}.c are even miscompiled with -O2 -fno-ipa-type-escape -fno-strict-aliasing. Mark, can this be a P1? -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu dot | |org, hjl at gcc dot gnu dot | |org, hubicka at gcc dot gnu | |dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33136