[ARM/AArch64] PR 68088: Fix RTL checking ICE due to subregs inside accumulator forwar...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Fri, 6 Nov 2015 12:04:15 +0000 (12:04 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Fri, 6 Nov 2015 12:04:15 +0000 (12:04 +0000)
        PR target/68088
        * config/arm/aarch-common.c (aarch_accumulator_forwarding): Strip
        subregs from accumulator and make sure it's a register.

        * gcc.dg/pr68088_1.c: New test.

From-SVN: r229845

gcc/ChangeLog
gcc/config/arm/aarch-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr68088_1.c [new file with mode: 0644]

index 9adcd20d1450737f44cf1a7178074ded80dfa100..3966f5158600e01c007d04a02fc7370e97b9a40a 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/68088
+       * config/arm/aarch-common.c (aarch_accumulator_forwarding): Strip
+       subregs from accumulator and make sure it's a register.
+
 2015-11-06  Simon Dardis  <simon.dardis@imgtec.com>
 
        * config/mips/loongson.md (vec_loongson_extract_lo_<mode>): New, extract
index a940a0232f84535215d2618bc7c5f8d0e396210a..e6668d5742c0c4f8b7ecc4f3e99198bb129b69a4 100644 (file)
@@ -460,6 +460,12 @@ aarch_accumulator_forwarding (rtx_insn *producer, rtx_insn *consumer)
        return 0;
     }
 
+  if (GET_CODE (accumulator) == SUBREG)
+    accumulator = SUBREG_REG (accumulator);
+
+  if (!REG_P (accumulator))
+    return 0;
+
   return (REGNO (dest) == REGNO (accumulator));
 }
 
index 3d1834dfb818892b2b0f4b7304bfa8b7bbdd6162..3bf8cf1bca00555261e23c88909a2cba0551a312 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/68088
+       * gcc.dg/pr68088_1.c: New test.
+
 2015-11-06  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/vect/bb-slp-38.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/pr68088_1.c b/gcc/testsuite/gcc.dg/pr68088_1.c
new file mode 100644 (file)
index 0000000..49c6aa1
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void bar (unsigned long);
+
+void
+foo (unsigned long aul, unsigned m, unsigned i)
+{
+  while (1)
+    {
+      aul += i;
+      i = aul % m;
+      bar (aul);
+    }
+}