Use reg_or_subregno instead.

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Committed as an obvious patch.

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         | 2 +-
 gcc/testsuite/gcc.target/i386/pr115452.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr115452.c

diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc
index e3e004d5526..607d1991460 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -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
index 00000000000..6c7935feb9f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr115452.c
@@ -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"
-- 
2.31.1

Reply via email to