When the attached testcase is compiled with gcc-4.4.1 there are two aliasing error messages issued, that appear to be wrong.
Created attachment 18593 [details] testcase command line: g++ -c -O5 -Wall pr.C
gcc-4.3.1 didn't issue such warnings. I wasn't able to minimize the testcase more. Somehow if eee instance of Zzzzz is removed and just Fffff::bbb() is called messages disappear. This is strange since code around lines in question is all the same in both cases.
The compiler warns for the store in D.1845_1 = (struct Fffff *) &eee.llll[0]; D.1854_8 ={v} &0B->D.1740.rrrr[0]; D.1845_1->ppp1 = D.1854_8; because that stores to eee.llll (type char) via a pointer to type Fffff which is invalid.
Subject: Re: Erroneous aliasing rules violation messages are issued rguenth at gcc dot gnu dot org wrote: > ------- Comment #3 from rguenth at gcc dot gnu dot org 2009-09-16 08:02 ------- > The compiler warns for the store in > > D.1845_1 = (struct Fffff *) &eee.llll[0]; > D.1854_8 ={v} &0B->D.1740.rrrr[0]; > D.1845_1->ppp1 = D.1854_8; > > because that stores to eee.llll (type char) via a pointer to type Fffff which > is invalid. > > If this is the case, I agree with the warning, but why is it placed in function 'bbb', and not in 'ggg'? 'ggg' is the one that converts from unsigned char to Fffff. I believe this is a bug that message is misplaced. This makes message misleading and confusing. Message line should be fixed, and also it should be one message, not two. This case should be reopened. Thank you, Yuri