This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42830] Inlining changes semantics when strict aliasing optimization is enabled
- From: "gary at intrepid dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2010 21:33:47 -0000
- Subject: [Bug c/42830] Inlining changes semantics when strict aliasing optimization is enabled
- References: <bug-42830-9975@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from gary at intrepid dot com 2010-01-21 21:33 -------
(In reply to comment #5)
> >Just to be clear, what aspect of the test case is undefined?
>
> The access of the integer variable via an union. That is the whole point of
> strict aliasing :).
I thought that might be what you were referring to, and understand how that is
undefined behavior. It sounds to me like the "resolution" of this issue is
that if the user had compiled with -Wall -Werror, then GCC would have issued
the warning that I'm looking for, but otherwise the test case is just another
casualty of "undefined behavior".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42830