]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AArch64] Restore recog state after finding pre-madd instruction
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 29 Oct 2014 21:56:01 +0000 (21:56 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 29 Oct 2014 21:56:01 +0000 (21:56 +0000)
    * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Restore
    recog state after aarch64_prev_real_insn call.

    * gcc.target/aarch64/madd_after_asm_1.c: New test.

From-SVN: r216854

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c [new file with mode: 0644]

index ed79e0ec9f9aaf6783e9af16ae34b7591741d39f..8d74c362b74a0990c731a05db99727a4cb699b60 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Restore
+       recog state after aarch64_prev_real_insn call.
+
 2014-10-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config.gcc (aarch64*-*-*): Define TARGET_FIX_ERR_A53_835769_DEFAULT
index d756763358b532bbf9f89088d61505cd1d9ed954..c262792890f6cb101339834cd092c86c4311ba93 100644 (file)
@@ -6148,6 +6148,10 @@ aarch64_madd_needs_nop (rtx insn)
     return false;
 
   prev = aarch64_prev_real_insn (insn);
+  /* aarch64_prev_real_insn can call recog_memoized on insns other than INSN.
+     Restore recog state to INSN to avoid state corruption.  */
+  extract_constrain_insn_cached (insn);
+
   if (!prev || !has_memory_op (prev))
     return false;
 
index 195a3c8fc3c20a0d398f07f53df9c128e45ede81..65c98a7f1daaa3206b4643746668b91bd91db25f 100644 (file)
@@ -1,3 +1,7 @@
+2014-10-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * gcc.target/aarch64/madd_after_asm_1.c: New test.
+
 2014-10-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/opt41.adb: New test.
diff --git a/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c b/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c
new file mode 100644 (file)
index 0000000..523941d
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -mfix-cortex-a53-835769" } */
+
+int
+test (int a, double b, int c, int d, int e)
+{
+  double result;
+  __asm__ __volatile ("// %0, %1"
+                      : "=w" (result)
+                      : "0" (b)
+                      :    /* No clobbers */
+                      );
+  return c * d + e;
+}