diff options
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 2 | ||||
-rw-r--r-- | test/CodeGen/ARM/2008-07-24-CodeGenPrepCrash.ll | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 15c225aebe..afc7ebc4c9 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -1598,7 +1598,7 @@ static bool isLegalAddressImmediate(int64_t V, MVT VT, /// by AM is legal for this target, for a load/store of the specified type. bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const { - if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty), Subtarget)) + if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty, true), Subtarget)) return false; // Can never fold addr of global into load/store. diff --git a/test/CodeGen/ARM/2008-07-24-CodeGenPrepCrash.ll b/test/CodeGen/ARM/2008-07-24-CodeGenPrepCrash.ll new file mode 100644 index 0000000000..6ea75eb5c7 --- /dev/null +++ b/test/CodeGen/ARM/2008-07-24-CodeGenPrepCrash.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=arm +; PR2589 + +define void @main({ i32 }*) { +entry: + %sret1 = alloca { i32 } ; <{ i32 }*> [#uses=1] + load { i32 }* %sret1 ; <{ i32 }>:1 [#uses=0] + ret void +} |