[cfe-commits] r66533 - in /cfe/trunk: lib/CodeGen/CGStmt.cpp test/CodeGen/asm.c

Chris Lattner sabre at nondot.org
Mon Mar 9 23:42:37 PDT 2009


Author: lattner
Date: Tue Mar 10 01:42:37 2009
New Revision: 66533

URL: http://llvm.org/viewvc/llvm-project?rev=66533&view=rev
Log:
Fix PR3682 by just disabling a broken assertion.  This check should be
done in sema, and is reflected by the existing PR3258.  In the meantime,
fix PR3682 by disabling a bogus assertion (which doesn't account for + 
operands).


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

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=66533&r1=66532&r2=66533&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Tue Mar 10 01:42:37 2009
@@ -707,8 +707,6 @@
   
   std::string Result;
   
-  unsigned NumOperands = S.getNumOutputs() + S.getNumInputs();
-  
   while (1) {
     // Done with the string?
     if (StrStart == StrEnd)
@@ -754,7 +752,8 @@
       StrStart = End;
       
       // FIXME: This should be caught during Sema.
-      assert(N < NumOperands && "Operand number out of range!");
+      //unsigned NumOperands = S.getNumOutputs() + S.getNumInputs();
+      //assert(N < NumOperands && "Operand number out of range!");
       
       if (Modifier == '\0')
         Result += '$' + llvm::utostr(N);

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

==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Tue Mar 10 01:42:37 2009
@@ -28,7 +28,7 @@
   __asm__ volatile("" : : "i" (t6));
 }
 
-// RUN: grep "T7 NAMED: \$2" %t
+// RUN: grep "T7 NAMED: \$2" %t &&
 void t7(int a) {
   __asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
 }
@@ -37,3 +37,9 @@
 void t8() {
   __asm__ volatile("T8 NAMED MODIFIER: %c[input]" :: [input] "i" (4));
 }
+
+// PR3682
+unsigned t9(unsigned int a) {
+  asm("bswap %0 %1" : "+r" (a));
+  return a;
+}





More information about the cfe-commits mailing list