[Bug target/83208] [arm-linux-gnueabi-gcc] wrong code at optimization level -O2 and -O3 for union assignment

2017-11-29 Thread ktkachov at gcc dot gnu.org
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.

[Bug target/83208] [arm-linux-gnueabi-gcc] wrong code at optimization level -O2 and -O3 for union assignment

2017-11-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83208

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Andrew Pinski  ---
The union here does not matter.

You are violating C aliasing rules.

You store via a long and then load via an int.  And not through an union.

[Bug target/83208] [arm-linux-gnueabi-gcc] wrong code at optimization level -O2 and -O3 for union assignment

2017-11-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83208

Richard Biener  changed:

   What|Removed |Added

 Target||arm-linux-gnueabi-gcc

--- Comment #1 from Richard Biener  ---
GCC 5 is no longer maintained, can you try GCC 6 or newer?