re PR rtl-optimization/70023 (ICE: in assign_by_spills, at lra-assigns.c:1417/8 with...
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 16 Feb 2018 18:17:09 +0000 (18:17 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 16 Feb 2018 18:17:09 +0000 (18:17 +0000)
2018-02-16  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/70023
* lra-constraints.c (inherit_in_ebb): Take hard reg mode of
src_regno into account.

2018-02-16  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/70023
* gcc.target/i386/pr70023.c: New.

From-SVN: r257751

gcc/ChangeLog
gcc/lra-constraints.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr70023.c [new file with mode: 0644]

index 78ea3af2f3b58f0071d85618d2ccf48bcfb1d53c..4a1a36fd4a4bafbfb7d6d7077c9c0ca37ee5f423 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-16  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/70023
+       * lra-constraints.c (inherit_in_ebb): Take hard reg mode of
+       src_regno into account.
+
 2018-02-16  Carl Love  <cel@us.ibm.com>
 
        * config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.
index 9d22da232f456d36aef7b6bace56cffdf44bc63a..d730f36fba0fac47ba3c17e01c9f3ffe0a9883c6 100644 (file)
@@ -6346,7 +6346,13 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
                                                 PSEUDO_REGNO_MODE (src_regno),
                                                 reg_renumber[src_regno]);
                        }
-                     add_next_usage_insn (src_regno, use_insn, reloads_num);
+                     if (src_regno >= FIRST_PSEUDO_REGISTER)
+                       add_next_usage_insn (src_regno, use_insn, reloads_num);
+                     else
+                       {
+                         for (i = 0; i < hard_regno_nregs (src_regno, reg->biggest_mode); i++)
+                           add_next_usage_insn (src_regno + i, use_insn, reloads_num);
+                       }
                    }
                }
          /* Process used call regs.  */
index b77afed11b7a42533559e8795784a84ab74581e9..e5aebb10baf9591babf82b211ae38832011841bb 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-16  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/70023
+       * gcc.target/i386/pr70023.c: New.
+
 2018-02-16  Carl Love  <cel@us.ibm.com>
 
        * gcc.target/powerpc/p9-vinsert4b-1.c: Remove test file for non-ABI
diff --git a/gcc/testsuite/gcc.target/i386/pr70023.c b/gcc/testsuite/gcc.target/i386/pr70023.c
new file mode 100644 (file)
index 0000000..57660e2
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O -fno-sched-critical-path-heuristic -fschedule-insns -m8bit-idiv -w" } */
+
+typedef int v8si __attribute__ ((vector_size (32)));
+typedef __int128 i128;
+
+i128
+foo(int u16_0, int u64_0, i128 u128_0, i128 u128_1, v8si v32u32_0, v8si v32u32_1, v8si v32u64_1)
+{
+  v32u32_0[6] <<= u128_1 & 31;
+  v32u32_0 &= (v8si){v32u64_1[2], v32u32_1[6], 0xc5a661b, 0, 2};
+  u128_1 += 0x16fe7853d732;
+  v32u32_1 /= (v8si){v32u32_0[5], u128_1, 0x92d} | 1;
+  return u128_0 + v32u32_1[1];
+}