]> granicus.if.org Git - clang/commitdiff
Fix PR3682 by just disabling a broken assertion. This check should be
authorChris Lattner <sabre@nondot.org>
Tue, 10 Mar 2009 06:42:37 +0000 (06:42 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 10 Mar 2009 06:42:37 +0000 (06:42 +0000)
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66533 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp
test/CodeGen/asm.c

index 1aa62e7e0368fa56f0bff4ba7127e2ffd709abe5..1ada5ba4190931c268026c5161f79ce39ac621ea 100644 (file)
@@ -707,8 +707,6 @@ static std::string ConvertAsmString(const AsmStmt& S, bool &Failed) {
   
   std::string Result;
   
-  unsigned NumOperands = S.getNumOutputs() + S.getNumInputs();
-  
   while (1) {
     // Done with the string?
     if (StrStart == StrEnd)
@@ -754,7 +752,8 @@ static std::string ConvertAsmString(const AsmStmt& S, bool &Failed) {
       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);
index 99655f8bb7c438bd58561a16f468fdf0a029c1a0..d6030a64ba8f9a2de0afd81894c551512f2d5806 100644 (file)
@@ -28,7 +28,7 @@ void t6(void) {
   __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 t7(int a) {
 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;
+}