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

Bob Wilson bob.wilson at apple.com
Mon Aug 9 17:11:13 PDT 2010


Author: bwilson
Date: Mon Aug  9 19:11:13 2010
New Revision: 110632

URL: http://llvm.org/viewvc/llvm-project?rev=110632&view=rev
Log:
Change EmitASM_EXPR to record the original type of an asm input, before the
special case of treating small structs and unions as integers.  If the
operand has a matching constraint and it is tied to one of the outputs
(for which small aggregates are not treated as integers), use that original
type to compare against the output operand.  Radar 8288710.

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=110632&r1=110631&r2=110632&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Aug  9 19:11:13 2010
@@ -4856,6 +4856,7 @@
       const Type *LLVMTy = ConvertType(type);
 
       Value *Op = 0;
+      const Type *OpTy = LLVMTy;
       if (LLVMTy->isSingleValueType()) {
         if (TREE_CODE(Val)==ADDR_EXPR &&
             TREE_CODE(TREE_OPERAND(Val,0))==LABEL_DECL) {
@@ -4884,10 +4885,10 @@
           // Otherwise, emit our value as a lvalue.
           isIndirect = true;
           Op = LV.Ptr;
+          OpTy = Op->getType();
         }
       }
 
-      const Type *OpTy = Op->getType();
       // If this input operand is matching an output operand, e.g. '0', check if
       // this is something that llvm supports. If the operand types are
       // different, then emit an error if 1) one of the types is not integer or
@@ -4946,13 +4947,12 @@
                                                  OTyBits-OpTyBits);
               Op = Builder.CreateLShr(Op, ShAmt);
             }
-            OpTy = Op->getType();
           }
         }
       }
 
       CallOps.push_back(Op);
-      CallArgTypes.push_back(OpTy);
+      CallArgTypes.push_back(Op->getType());
     } else {                          // Memory operand.
       lang_hooks.mark_addressable(TREE_VALUE(Input));
       isIndirect = true;





More information about the llvm-commits mailing list