http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46488
--- Comment #39 from Paulo César Pereira de Andrade <pcpa at mandriva dot com.br> 2010-12-01 18:25:50 UTC --- (In reply to comment #38) > (In reply to comment #37) > > > If you'd re-use the same type the issue would go away as well (I think). > > > > Yes, this works for the testcase, but probably only because the problematic > > fields are now volatile too (APR_RING_ENTRY has volatile fields, > > APR_RING_HEAD > > doesn't). The warning is still emitted for the more natural: > > > > #define APR_RING_SENTINEL(hp, elem, link) \ > > (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link)) > > > > with -Wstrict-aliasing so the underlying aliasing issue is probably still > > there. > > > > Closing as "invalid" since the original SPARC issues were fixed elsewhere > > and > > the -O3 issue is an aliasing violation in the source code. > > Maybe this should this be considered a problem in the sense that it > does not warn with -Wstrict-aliasing ? As in this case, httpd source > was patched to "correct" the warning, but the problem remained. > I mean, otherwise it is a kind of "please use -fno-strict-aliasing" > for everything you do not want to risk having incorrect code generation. Damn, sorry for quickly replying to myself. It warns with both -Wstrict-aliasing=1 and -Wstrict-aliasing=2