[Bug target/106707] [13 Regression] ICE: in cselib_record_set, at cselib.cc:2687 with -Oz -g -fno-cprop-registers -fno-dce since r13-1945-gfc6ef90173478521
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 30 10:08:42 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106707
--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
The following pattern is matched by a peephole2 pattern:
(insn 164 161 165 5 (set (reg:DI 0 ax [orig:91 _10 ] [91])
(reg:DI 0 ax)) "pr106707.c":13:12 82 {*movdi_internal}
(expr_list:REG_UNUSED (reg:DI 0 ax [orig:91 _10 ] [91])
(nil)))
and produces invalid RTL:
(insn 196 161 197 5 (parallel [
(set (reg:DI 0 ax [orig:91 _10 ] [91])
(reg:DI 0 ax))
(set (reg:DI 0 ax)
(reg:DI 0 ax [orig:91 _10 ] [91]))
]) "pr106707.c":13:12 -1
(nil))
The fix is similar to the one proposed in Comment #4, but we can use:
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a4a18cf89f5..1aef1af594d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3043,8 +3043,8 @@
[(set (match_operand:SWI48 0 "general_reg_operand")
(match_operand:SWI48 1 "general_reg_operand"))]
"optimize_size > 1
- && (REGNO (operands[0]) == AX_REG
- || REGNO (operands[1]) == AX_REG)
+ && ((REGNO (operands[0]) == AX_REG)
+ != (REGNO (operands[1]) == AX_REG))
&& 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