This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83208] [arm-linux-gnueabi-gcc] wrong code at optimization level -O2 and -O3 for union assignment
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Nov 2017 09:59:11 +0000
- Subject: [Bug target/83208] [arm-linux-gnueabi-gcc] wrong code at optimization level -O2 and -O3 for union assignment
- Auto-submitted: auto-generated
- References: <bug-83208-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83208
--- Comment #3 from ktkachov at gcc dot gnu.org ---
The testcase is "fixed" by using -fno-strict-aliasing.
In this example pointers c and d alias each other, they are of incompatible
types and they are both dereferenced, so the testcase has undefined behaviour.