PR target/96558: Only call ix86_expand_clear with GENERAL_REGS.
authorRoger Sayle <roger@nextmovesoftware.com>
Wed, 12 Aug 2020 21:34:29 +0000 (22:34 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Wed, 12 Aug 2020 21:34:29 +0000 (22:34 +0100)
commit32c69a56981bd72a52b7d234a2936020f97909d1
tree79477263f2452f353475f7bc4d3d2c012fcd2985
parent86f8741485600457bc03d33692c5e5044b7bb479
PR target/96558: Only call ix86_expand_clear with GENERAL_REGS.

The following patch tightens the predicates of the peephole2 from my recent
"Integer min/max improvements patch" to only hoist clearing a register when
that register is a general register.  Calling ix86_expand_clear with regs
other than GENERAL_REGS is not supported.

2020-08-12  Roger Sayle  <roger@nextmovesoftware.com>
    Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog
PR target/96558
* config/i386/i386.md (peephole2): Only reorder register clearing
instructions to allow use of xor for general registers.

gcc/testsuite/ChangeLog
PR target/96558
* gcc.dg/pr96558.c: New test.
gcc/config/i386/i386.md
gcc/testsuite/gcc.dg/pr96558.c [new file with mode: 0644]