]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix ICE due to REGNO of a SUBREG.
authorliuhongt <hongtao.liu@intel.com>
Thu, 13 Jun 2024 01:53:58 +0000 (09:53 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 13 Jun 2024 04:55:01 +0000 (12:55 +0800)
Use reg_or_subregno instead.

gcc/ChangeLog:

PR target/115452
* config/i386/i386-features.cc (scalar_chain::convert_op): Use
reg_or_subregno instead of REGNO to avoid ICE.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr115452.c: New test.

gcc/config/i386/i386-features.cc
gcc/testsuite/gcc.target/i386/pr115452.c [new file with mode: 0644]

index e3e004d55267f6ad7cc8c02658aa457acc57beb5..607d19914606b6be8c5633a3391e5ac01bc64ca8 100644 (file)
@@ -1054,7 +1054,7 @@ scalar_chain::convert_op (rtx *op, rtx_insn *insn)
 
       if (dump_file)
        fprintf (dump_file, "  Preloading operand for insn %d into r%d\n",
-                INSN_UID (insn), REGNO (tmp));
+                INSN_UID (insn), reg_or_subregno (tmp));
     }
   else if (REG_P (*op))
     *op = gen_rtx_SUBREG (vmode, *op, 0);
diff --git a/gcc/testsuite/gcc.target/i386/pr115452.c b/gcc/testsuite/gcc.target/i386/pr115452.c
new file mode 100644 (file)
index 0000000..6c7935f
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv -mno-bmi -mno-stackrealign -fdump-rtl-stv2" } */
+
+#include "pr70322-2.c"