From b06a0ed4b09754501fddd164ba6125ee8ae9bcd5 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Fri, 8 Nov 2013 18:14:17 +0000 Subject: [VirtRegMap] Fix for PR17825. Do not ignore noreturn definitions when setting isPhysRegUsed if the unwind information is required. Indeed, the runtime may need a correct stack to be able to unwind the call. llvm-svn: 194271 --- llvm/lib/CodeGen/VirtRegMap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp') diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 0a08608ecfc..e0aa4053987 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -285,7 +285,11 @@ void VirtRegRewriter::rewrite() { if (!MO.isGlobal()) continue; const Function *Func = dyn_cast(MO.getGlobal()); - if (!Func || !Func->hasFnAttribute(Attribute::NoReturn)) + if (!Func || !Func->hasFnAttribute(Attribute::NoReturn) || + // We need to keep correct unwind information + // even if the function will not return, since the + // runtime may need it. + !Func->hasFnAttribute(Attribute::NoUnwind)) continue; NoReturnInsts.insert(MI); break; -- cgit v1.2.3