[Bug rtl-optimization/107057] [10/11/12/13 Regression] ICE in extract_constrain_insn, at recog.cc:2692

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Oct 25 09:15:54 GMT 2022


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

--- Comment #5 from Hongtao.liu <crazylht at gmail dot com> ---
I'm testing

modified   gcc/lra-constraints.cc
@@ -4382,7 +4382,14 @@ curr_insn_transform (bool check_only_p)
                 (op, (enum reg_class) goal_alt[i]) == NO_REGS)
                || no_input_reloads_p))
          {
-           rtx tem = force_const_mem (mode, op);
+           rtx tem;
+
+           /* PR 107057, for same constant pool, don't bother
+              force_const_mem again, just reuse the matched op.  */
+           if (goal_alt_matches[i] >= 0)
+             tem = *curr_id->operand_loc[goal_alt_matches[i]];
+           else
+             tem = force_const_mem (mode, op);

            change_p = true;
            if (subreg != NULL_RTX)


More information about the Gcc-bugs mailing list