[Bug c/65892] gcc fails to implement N685 aliasing of union members

txr at alumni dot caltech.edu gcc-bugzilla@gcc.gnu.org
Wed Nov 2 19:25:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892

--- Comment #22 from Tim Rentsch <txr at alumni dot caltech.edu> ---
[responding to comments from rguenther@suse.de in Comment 20]

> GCC already implements this if you specify -fno-strict-aliasing.

The main point of my comments is that the ISO C standard requires
the behavior in this case (and similar cases) be defined and not
subject to any reordering.  In other words the result must be the
same as an unoptimized version.  If a -fstrict-aliasing gcc /does/
transform the code so that the behavior is not the same as an
unoptimized version, then gcc is not a conforming implementation.
Or is it your position that gcc is conforming only when operated
in the -fno-strict-aliasing mode?  That position seems contrary to
the documented description of the -fstrict-aliasing option.


More information about the Gcc-bugs mailing list