mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Fix PR3468: a crash when constant folding a bitcast of
i80 to x86 long double (this was presumably generated by sroa). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63730 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -154,11 +154,10 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) {
|
|||||||
// be the same. Consequently, we just fold to V.
|
// be the same. Consequently, we just fold to V.
|
||||||
return V;
|
return V;
|
||||||
|
|
||||||
if (DestTy->isFloatingPoint()) {
|
if (DestTy->isFloatingPoint())
|
||||||
assert((DestTy == Type::DoubleTy || DestTy == Type::FloatTy) &&
|
return ConstantFP::get(APFloat(CI->getValue(),
|
||||||
"Unknown FP type!");
|
DestTy != Type::PPC_FP128Ty));
|
||||||
return ConstantFP::get(APFloat(CI->getValue()));
|
|
||||||
}
|
|
||||||
// Otherwise, can't fold this (vector?)
|
// Otherwise, can't fold this (vector?)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
7
test/Transforms/InstCombine/2009-02-04-FPBitcast.ll
Normal file
7
test/Transforms/InstCombine/2009-02-04-FPBitcast.ll
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
; RUN: llvm-as < %s | opt -instcombine
|
||||||
|
; PR3468
|
||||||
|
|
||||||
|
define x86_fp80 @cast() {
|
||||||
|
%tmp = bitcast i80 0 to x86_fp80 ; <x86_fp80> [#uses=1]
|
||||||
|
ret x86_fp80 %tmp
|
||||||
|
}
|
Reference in New Issue
Block a user