[llvm-commits] [llvm-gcc-4.2] r61604 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Evan Cheng evan.cheng at apple.com
Sat Jan 3 00:39:34 PST 2009


Author: evancheng
Date: Sat Jan  3 02:39:33 2009
New Revision: 61604

URL: http://llvm.org/viewvc/llvm-project?rev=61604&view=rev
Log:
Fix PR3257: Allow +g output constraint. It's treated as two input and output constraints tied together.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=61604&r1=61603&r2=61604&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Jan  3 02:39:33 2009
@@ -4124,7 +4124,6 @@
     }
     
     LValue Dest = EmitLV(Operand);
-    CallResultIsSigned.push_back(!TYPE_UNSIGNED(TREE_TYPE(Operand)));
     const Type *DestValTy =
       cast<PointerType>(Dest.Ptr->getType())->getElementType();
     
@@ -4134,6 +4133,7 @@
       ConstraintStr += ",=";
       ConstraintStr += SimplifiedConstraint;
       CallResultTypes.push_back(DestValTy);
+      CallResultIsSigned.push_back(!TYPE_UNSIGNED(TREE_TYPE(Operand)));
     } else {
       ConstraintStr += ",=*";
       ConstraintStr += SimplifiedConstraint;
@@ -4203,8 +4203,9 @@
       // is big endian.
       if (ISDIGIT(Constraint[0])) {
         unsigned Match = atoi(Constraint);
-        const Type *OTy = CallResultTypes[Match];
-        if (OTy != OpTy) {
+        const Type *OTy = (Match > CallResultTypes.size())
+          ? CallResultTypes[Match] : 0;
+        if (OTy && OTy != OpTy) {
           if (!(isa<IntegerType>(OTy) || isa<PointerType>(OTy)) ||
               !(isa<IntegerType>(OpTy) || isa<PointerType>(OpTy))) {
             error("%Hunsupported inline asm: input constraint with a matching "





More information about the llvm-commits mailing list