https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67090
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |trippels at gcc dot gnu.org
--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Dāvis from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > This is such an obvious violation of aliasing rules in c/c++.
> > Use memcpy or an Union (gcc extension) to get around the it. You can use
> > -fno-strict-aliasing too.
>
> Then warning (or error) would be more appropriate than silently generating
> invalid code as currently there's no warning even with -Wall
You'll get the warning with -Wstrict-aliasing=2 or -Wstrict-aliasing=1.