Improve preservation of FLAGS_REG mode in i386.md's peephole2s.
authorRoger Sayle <roger@nextmovesoftware.com>
Sat, 9 Jul 2022 08:07:18 +0000 (09:07 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Sat, 9 Jul 2022 08:07:18 +0000 (09:07 +0100)
commitb434c94bf7a5d4bb9ca8f0b5442ca85b43f32a9a
tree3d69b4f99a965587e364d51b132cb228c2d16cc4
parent002d81affa8a4e625993d3c9c7840ca4aba9750c
Improve preservation of FLAGS_REG mode in i386.md's peephole2s.

The patch tweaks several peephole2s in i386.md that propagate the flags
register, but take its mode from the SET_SRC rather than preserve the
mode of the original SET_DEST.  This encounters problems when the
SET_SRC is a VOIDmode CONST_INT.  Fixed by using match_operand with a
flags_reg_operand predicate.

2022-07-09  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* config/i386/i386.md (define_peephole2): Use match_operand of
flags_reg_operand to capture and preserve the mode of FLAGS_REG.
(define_peephole2): Likewise.
(define_peephole2): Likewise...
gcc/config/i386/i386.md