[llvm-commits] [dragonegg] r115925 - /dragonegg/trunk/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Thu Oct 7 10:08:14 PDT 2010


Author: baldrick
Date: Thu Oct  7 12:08:14 2010
New Revision: 115925

URL: http://llvm.org/viewvc/llvm-project?rev=115925&view=rev
Log:
Port commit 112531 (stuart) from llvm-gcc:
Fix an assertion in the GCC DejaGNU testsuite.  Radar 8251350.

Modified:
    dragonegg/trunk/llvm-convert.cpp

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=115925&r1=115924&r2=115925&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Thu Oct  7 12:08:14 2010
@@ -3766,6 +3766,11 @@
     EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop);
     Result = Builder.CreateBinOp(Instruction::And, Result,
                                  ConstantInt::get(Result->getType(), 1));
+    tree return_type = gimple_call_return_type(stmt);
+    const Type *DestTy = ConvertType(return_type);
+    Result = Builder.CreateIntCast(Result, DestTy,
+                                   /*isSigned*/!TYPE_UNSIGNED(return_type),
+                                   "cast");
     return true;
   }
   case BUILT_IN_POPCOUNT:  // These GCC builtins always return int.





More information about the llvm-commits mailing list