[Bug target/86314] [7/8/9 Regression] GCC 7.x and 8.x zero out "eax" before using "rax" in "lock bts"
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 26 07:37:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86314
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |uros at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Goes wrong in peephole2:
Splitting with gen_peephole2_28
;; Convert setcc + movzbl to xor + setcc if operands don't overlap.
...
(define_peephole2
[(parallel [(set (reg FLAGS_REG) (match_operand 0))
(match_operand 4)])
(set (match_operand:QI 1 "register_operand")
(match_operator:QI 2 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)]))
(set (match_operand 3 "any_QIreg_operand")
(zero_extend (match_dup 1)))]
"(peep2_reg_dead_p (3, operands[1])
|| operands_match_p (operands[1], operands[3]))
&& ! reg_overlap_mentioned_p (operands[3], operands[0])
&& ! reg_set_p (operands[3], operands[4])
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 5) (match_dup 0))
(match_dup 4)])
(set (strict_low_part (match_dup 6))
(match_dup 2))]
{
operands[5] = gen_rtx_REG (GET_MODE (operands[0]), FLAGS_REG);
operands[6] = gen_lowpart (QImode, operands[3]);
ix86_expand_clear (operands[3]);
})
looks like the peephole was added by Uros (and refined multiple times already)
More information about the Gcc-bugs
mailing list