http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46488
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |INVALID --- Comment #37 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-12-01 12:15:02 UTC --- > 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.