aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2014-11-05 14:25:07 -0800
committerRong Xu <xur@google.com>2014-11-05 14:25:07 -0800
commitba21122c63b06a70b620c8990c517b87198ad05b (patch)
treeba7f334580c346987b5686ffc95dcc6a732a931c /gcc-4.9/gcc
parent39dbe572beead93798002c03b4897afaf018cd04 (diff)
downloadtoolchain_gcc-ba21122c63b06a70b620c8990c517b87198ad05b.zip
toolchain_gcc-ba21122c63b06a70b620c8990c517b87198ad05b.tar.gz
toolchain_gcc-ba21122c63b06a70b620c8990c517b87198ad05b.tar.bz2
[4.9] Restore recog state after finding pre-madd instruction.
This patch backports svn r216853 from upsteam gcc-4.9 branch that fixed a bug introduced in fixing cortex a53 erratum 835769. Change-Id: Iccc6fd04ede28c2deba51be3f8e348ce374c8b4f
Diffstat (limited to 'gcc-4.9/gcc')
-rw-r--r--gcc-4.9/gcc/ChangeLog5
-rw-r--r--gcc-4.9/gcc/config/aarch64/aarch64.c4
-rw-r--r--gcc-4.9/gcc/testsuite/ChangeLog4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c14
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/ChangeLog b/gcc-4.9/gcc/ChangeLog
index ce45f71..b8aa734 100644
--- a/gcc-4.9/gcc/ChangeLog
+++ b/gcc-4.9/gcc/ChangeLog
@@ -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-27 Guozhi Wei <carrot@google.com>
PR tree-optimization/63530
diff --git a/gcc-4.9/gcc/config/aarch64/aarch64.c b/gcc-4.9/gcc/config/aarch64/aarch64.c
index 34986d7..2ff6c7c 100644
--- a/gcc-4.9/gcc/config/aarch64/aarch64.c
+++ b/gcc-4.9/gcc/config/aarch64/aarch64.c
@@ -6571,6 +6571,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)
return false;
diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog
index 2200c12..1881e17 100644
--- a/gcc-4.9/gcc/testsuite/ChangeLog
+++ b/gcc-4.9/gcc/testsuite/ChangeLog
@@ -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-27 Guozhi Wei <carrot@google.com>
PR tree-optimization/63530
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c
new file mode 100644
index 0000000..523941d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c
@@ -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;
+}