------- Comment #23 from dberlin at gcc dot gnu dot org 2007-08-24 16:21 ------- Subject: Re: [4.1/4.2/4.3 Regression] wrong code due to alias with allocation in loop
On 24 Aug 2007 16:16:44 -0000, jakub at gcc dot gnu dot org <[EMAIL PROTECTED]> wrote: > > > ------- Comment #22 from jakub at gcc dot gnu dot org 2007-08-24 16:16 > ------- > Not sure how, could I pass the buck to you then? > > My thought was just that may_alias_p could for STRUCT_FIELD_TAG call > ipa_type_escape_field_does_not_clobber (TREE_TYPE (SFT_PARENT_VAR (var)), > TREE_TYPE (var)) (i.e. don't care about PTRs type, just say if that field's > address wasn't ever taken that it can't alias. That would be similar to how > alias.c uses this function (again, doesn't use the pointer type at all). > This would work too. I will take care of it in about a week if you don't get their first. > Anyway, I found that current GCC 4.2 miscompiles following modified testcase > (works with 4.1 and the trunk, though neither 4.1 nor 4.3 actually optimize > bar > function as they could). 4.2 optimizes bar and misoptimizes baz, by assuming > *x = 4; will not clobber s.b. For 4.2, the safest thing to do is just remove the call from may_alias_p. I serously doubt this will have any real effect on performance. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33136