[Bug target/87223] -Os produces sub-optimal x86 machine code for initialization with zero
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 5 09:49:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87223
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization, ra
Target| |x86_64-*-* i?86-*-*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-09-05
CC| |vmakarov at gcc dot gnu.org
Component|c++ |target
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. I believe there are duplicates for this and I believe this
optimization would be beneficial for -O2+ as well. Note that with -O2 we
generate
xorl %eax, %eax
movb $0, (%rdi)
movq $0, 8(%rdi)
movw %ax, 16(%rdi)
movq $0, 24(%rdi)
ret
the movw variant is generated by peephole2.
I suppose LRA could be the place to "remat" constants.
More information about the Gcc-bugs
mailing list