diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2022-03-11 17:57:12 +0000 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2022-03-11 17:57:12 +0000 |
commit | 251ea6dfbdb4448875e41081682bb3aa451b5729 (patch) | |
tree | 1297567f040ce10d1d026251a788f7abf62e896f /gcc/cp | |
parent | c5288df751f9ecd11898dec5f2a7b6b03267f79e (diff) | |
download | gcc-251ea6dfbdb4448875e41081682bb3aa451b5729.zip gcc-251ea6dfbdb4448875e41081682bb3aa451b5729.tar.gz gcc-251ea6dfbdb4448875e41081682bb3aa451b5729.tar.bz2 |
PR tree-optimization/98335: New peephole2 xorl;movb -> movzbl
This patch is the backend piece of my proposed fix to PR tree-opt/98335,
to allow C++ partial struct initialization to be as efficient/optimized
as full struct initialization.
With the middle-end patch just posted to gcc-patches, the test case
in the PR compiles on x86_64-pc-linux-gnu with -O2 to:
xorl %eax, %eax
movb c(%rip), %al
ret
with this additional peephole2 (actually four peephole2s):
movzbl c(%rip), %eax
ret
2022-03-11 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
PR tree-optimization/98335
* config/i386/i386.md (peephole2): Eliminate redundant insv.
Combine movl followed by movb. Transform xorl followed by
a suitable movb or movw into the equivalent movz[bw]l.
gcc/testsuite/ChangeLog
PR tree-optimization/98335
* g++.target/i386/pr98335.C: New test case.
* gcc.target/i386/pr98335.c: New test case.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions