Revision: 125989 Author: clattner Date: 2007-04-11 15:35:32 -0700 (Wed, 11 Apr 2007)
Log Message: ----------- Fix a front-end crash on CFrontend/2007-04-11-InlineAsmUnion.c, in which an inline asm is emitting a store into a union (!?). There is still a backend crash as well. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 21:34:37 UTC (rev 125988) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 22:35:32 UTC (rev 125989) @@ -3601,13 +3601,16 @@ std::string SimplifiedConstraint = '='+CanonicalizeConstraint(Constraint+1); LValue Dest = EmitLV(Operand); + const Type *DestValTy = + cast<PointerType>(Dest.Ptr->getType())->getElementType(); assert(!Dest.isBitfield() && "Cannot assign into a bitfield!"); - if (ConstraintStr.empty() && !AllowsMem) { // Reg dest and no output yet? + if (ConstraintStr.empty() && !AllowsMem && + DestValTy->isFirstClassType()) { // Reg dest and no output yet? assert(StoreCallResultAddr == 0 && "Already have a result val?"); StoreCallResultAddr = Dest.Ptr; ConstraintStr += ","; ConstraintStr += SimplifiedConstraint; - CallResultType = cast<PointerType>(Dest.Ptr->getType())->getElementType(); + CallResultType = DestValTy; } else { ConstraintStr += ",="; ConstraintStr += SimplifiedConstraint; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits