[Bug rtl-optimization/106707] [13 Regression] ICE: in cselib_record_set, at cselib.cc:2687 with -Oz -g -fno-cprop-registers -fno-dce since r13-1945-gfc6ef90173478521

yinyuefengyi at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 23 02:32:23 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106707

--- Comment #4 from Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at gmail dot com> ---
Maybe guard the pattern with...

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 58fcc382fa2..2a9d70da6d0 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3045,6 +3045,7 @@ (define_peephole2
  "optimize_size > 1
   && (REGNO (operands[0]) == AX_REG
       || REGNO (operands[1]) == AX_REG)
+  && REGNO(operands[0]) != REGNO(operands[1])
   && optimize_insn_for_size_p ()
   && peep2_reg_dead_p (1, operands[1])"
   [(parallel [(set (match_dup 0) (match_dup 1))


More information about the Gcc-bugs mailing list