[cfe-commits] r68371 - in /cfe/trunk: lib/AST/Stmt.cpp test/CodeGen/asm.c

Anders Carlsson andersca at mac.com
Thu Apr 2 22:57:08 PDT 2009


Author: andersca
Date: Fri Apr  3 00:57:08 2009
New Revision: 68371

URL: http://llvm.org/viewvc/llvm-project?rev=68371&view=rev
Log:
Ignore plus operands when looking up the operand number from a named operand. This matches llvm-gcc and fixes PR3908.

Modified:
    cfe/trunk/lib/AST/Stmt.cpp
    cfe/trunk/test/CodeGen/asm.c

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=68371&r1=68370&r2=68371&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Fri Apr  3 00:57:08 2009
@@ -177,9 +177,6 @@
   for (unsigned i = 0, e = getNumOutputs(); i != e; ++i) {
     if (getOutputName(i) == SymbolicName)
       return i;
-    
-    // Keep track of the number of '+' operands.
-    if (isOutputPlusConstraint(i)) ++NumPlusOperands;
   }
   
   for (unsigned i = 0, e = getNumInputs(); i != e; ++i)

Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=68371&r1=68370&r2=68371&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Fri Apr  3 00:57:08 2009
@@ -28,7 +28,7 @@
   __asm__ volatile("" : : "i" (t6));
 }
 
-// RUN: grep "T7 NAMED: \$2" %t &&
+// RUN: grep "T7 NAMED: \$1" %t &&
 void t7(int a) {
   __asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
 }
@@ -43,3 +43,9 @@
   asm("bswap %0 %1" : "+r" (a));
   return a;
 }
+
+// PR3908
+// RUN: grep "PR3908 \$1 \$3 \$2 \$0" %t
+void t10(int r) {
+  __asm__("PR3908 %[lf] %[xx] %[li] %[r]" : [r] "+r" (r) : [lf] "mx" (0), [li] "mr" (0), [xx] "x" ((double)(0)));
+}         





More information about the cfe-commits mailing list