OSDN Git Service

PR target/43897
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Dec 2010 19:31:57 +0000 (19:31 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Dec 2010 19:31:57 +0000 (19:31 +0000)
* config/ia64/ia64.c (rtx_needs_barrier): Handle asm CLOBBER
as a store into that register.

* gcc.target/ia64/pr43897.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167516 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 48c60c0..cc1d2c6 100644 (file)
@@ -1,5 +1,9 @@
 2010-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/43897
+       * config/ia64/ia64.c (rtx_needs_barrier): Handle asm CLOBBER
+       as a store into that register.
+
        PR tree-optimization/46528
        PR debug/46338
        * profile.c (branch_prob): Make sure last is never set to a debug
index 0c2d20e..f789d00 100644 (file)
@@ -6320,6 +6320,17 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
              break;
 
            case CLOBBER:
+             if (REG_P (XEXP (pat, 0))
+                 && extract_asm_operands (x) != NULL_RTX
+                 && REGNO (XEXP (pat, 0)) != AR_UNAT_REGNUM)
+               {
+                 new_flags.is_write = 1;
+                 need_barrier |= rtx_needs_barrier (XEXP (pat, 0),
+                                                    new_flags, pred);
+                 new_flags = flags;
+               }
+             break;
+
            case RETURN:
              break;
 
index f64afd4..b0ed621 100644 (file)
@@ -1,5 +1,8 @@
 2010-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/43897
+       * gcc.target/ia64/pr43897.c: New test.
+
        PR debug/46771
        * gcc.dg/pr46771.c: New test.
 
diff --git a/gcc/testsuite/gcc.target/ia64/pr43897.c b/gcc/testsuite/gcc.target/ia64/pr43897.c
new file mode 100644 (file)
index 0000000..fb73e86
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/43897 */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+int
+sub (int i)
+{
+  float tmp;
+  if (i)
+    __asm__ __volatile__ ("frcpa.s0 %0,p1=f0,f0":"=f" (tmp)::"p1");
+  return i + 10;
+}