[Bug target/33989] Extra load/store for float with union
seurer at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 30 15:04:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33989
seurer at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |seurer at gcc dot gnu.org
Resolution|--- |WORKSFORME
--- Comment #17 from seurer at gcc dot gnu.org ---
The reported problem was that with -O3 you get an extra load/store:
.L.f:
lfs 0,0(3)
fadds 0,1,0
stfs 0,-16(1)
lwz 0,-16(1)
stw 0,0(4)
blr
I tried the test code using both gcc 9 and 10 (on both powerpc64 BE and LE just
in case) and I see this:
f:
.LFB0:
.cfi_startproc
lfs 0,0(3)
fadds 1,1,0
stfs 1,0(4)
blr
No extra load/store.
FYI: I looked at gcc 5 (the distro version on one of older servers) and it
generated way different and probably equally not so good code. I tried on
another older system that has gcc 4.8.5 and it did indeed generate the extra
load/store as reported.
More information about the Gcc-bugs
mailing list