[LLVMbugs] [Bug 924] Non-extended inline assembly statements should have asmstrings interpreted

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Sep 28 11:59:58 PDT 2006


http://llvm.org/bugs/show_bug.cgi?id=924

sabre at nondot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Keywords|                            |compile-fail
         OS/Version|Linux                       |All
           Platform|PC                          |All
         Resolution|                            |FIXED
            Summary|Unsupported inline assembly |Non-extended inline assembly
                   |statement                   |statements should have
                   |                            |asmstrings interpreted
   Target Milestone|---                         |1.9
            Version|trunk                       |1.7



------- Additional Comments From sabre at nondot.org  2006-09-28 13:59 -------
Fixed.  Testcase here:
Regression/CFrontend/2006-09-28-SimpleAsm.c

Patch here:

===============================================================
====
--- llvm-convert.cpp    (revision 118365)
+++ llvm-convert.cpp    (working copy)
@@ -2443,6 +2443,20 @@
   tree str = ASM_STRING(exp);
   if (TREE_CODE(str) == ADDR_EXPR) str = TREE_OPERAND(str, 0);
 
+  // ASM_INPUT_P - This flag is set if this is a non-extended ASM, which means
+  // that the asm string should not be interpreted, other than to escape $'s.
+  if (ASM_INPUT_P(exp)) {
+    const char *InStr = TREE_STRING_POINTER(str);
+    std::string Result;
+    while (1) {
+      switch (*InStr++) {
+      case 0: return Result;                 // End of string.
+      default: Result += InStr[-1]; break;   // Normal character.
+      case '$': Result += "$$"; break;       // Escape '$' characters.
+      }
+    }
+  }
+  
   // Expand [name] symbolic operand names.
   str = resolve_asm_operand_names(str, ASM_OUTPUTS(exp), ASM_INPUTS(exp));
 
-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list