Skip to content
Commit 3625f3ef authored by Guozhi Wei's avatar Guozhi Wei
Browse files

[CGExprScalar] In EmitCompare trunc the result if it has different type as E->getType()

Usually compare expression should return i1 type, so EmitScalarConversion is called before return

return EmitScalarConversion(Result, CGF.getContext().BoolTy, E->getType(), E->getExprLoc());

But when ppc intrinsic is called to compare vectors, the ppc intrinsic can return i32 even E->getType() is BoolTy, in this case EmitScalarConversion does nothing, an i32 type result is returned and causes crash later.

This patch detects this case and truncates the result before return.

Differential Revision: https://reviews.llvm.org/D38656

llvm-svn: 315358
parent cc85223f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment