]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/60663 (Errors out on valid inline asm)
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Apr 2014 10:11:01 +0000 (12:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 11 Apr 2014 10:11:01 +0000 (12:11 +0200)
PR rtl-optimization/60663
* cse.c (cse_insn): Set src_volatile on ASM_OPERANDS in
PARALLEL.

* gcc.target/arm/pr60663.c: New test.

From-SVN: r209293

gcc/ChangeLog
gcc/cse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr60663.c [new file with mode: 0644]

index 0aa9562b12e601daaf1c23ca25e9866edfd6eee9..d702fae6b6f8407b738f5843efe0de057b7f0a62 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/60663
+       * cse.c (cse_insn): Set src_volatile on ASM_OPERANDS in
+       PARALLEL.
+
 2014-04-10  Jan Hubicka  <hubicka@ucw.cz>
            Jakub Jelinek  <jakub@redhat.com>
 
index 852d13ebf5bcdc13a1a7ad6fcb2759abba371c0c..b8223f7a35e15b068614d6b583473e33d6b1b6fc 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4642,6 +4642,13 @@ cse_insn (rtx insn)
          && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
        sets[i].src_volatile = 1;
 
+      /* Also do not record result of a non-volatile inline asm with
+        more than one result or with clobbers, we do not want CSE to
+        break the inline asm apart.  */
+      else if (GET_CODE (src) == ASM_OPERANDS
+              && GET_CODE (x) == PARALLEL)
+       sets[i].src_volatile = 1;
+
 #if 0
       /* It is no longer clear why we used to do this, but it doesn't
         appear to still be needed.  So let's try without it since this
index a8bf48f4d53efc2d44ab67156162977f81e901ce..c9dbd8a2643eda8d1d3e46074d02e4ce04751446 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/60663
+       * gcc.target/arm/pr60663.c: New test.
+
 2014-04-10  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/dso/dlclose1.C: Disable for 4.9.
diff --git a/gcc/testsuite/gcc.target/arm/pr60663.c b/gcc/testsuite/gcc.target/arm/pr60663.c
new file mode 100644 (file)
index 0000000..b79b830
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR rtl-optimization/60663 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv7-a" } */
+
+int
+foo (void)
+{
+  unsigned i, j;
+  asm ("%0 %1" : "=r" (i), "=r" (j));
+  return i;
+}