<div dir="ltr">I think r262546 introduced the assumption that allocas are used exactly once with catchpad. It seems easy to fix, though.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 17, 2016 at 11:51 PM, Carlo Kok via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This turned out to be related to reusing the local used in the catchpad, for example given the following c++ code:<br>
<br>
extern void rthrow();<br>
<br>
int main() {<br>
    try<br>
    {<br>
        try {<br>
            rthrow();<br>
        } catch(int* v) {<br>
            rthrow();<br>
        }<br>
    } catch (int* v)<br>
    {<br>
        rthrow();<br>
    }<br>
    return 0;<br>
}<br>
<br>
Generates two:<br>
<br>
  %7 = catchpad within %5 [%rtti.TypeDescriptor4* @"\01??_R0PAH@8", i32 0, i32** %2]<br>
  %11 = catchpad within %9 [%rtti.TypeDescriptor4* @"\01??_R0PAH@8", i32 0, i32** %3]<br>
<br>
If I change either of them to have the %2 in both, it crashes llvm.<div class="HOEnZb"><div class="h5"><br>
<br>
On 2016-10-17 18:02, Carlo Kok via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm gettign an assertion fail/crash in<br>
X86FrameLowering::GetFrameInde<wbr>xReference when compiling the following<br>
bitcode:<br>
<br>
<a href="https://gist.github.com/carlokok/868cddebeb9acc8ccbac6253de0480b0" rel="noreferrer" target="_blank">https://gist.github.com/carlok<wbr>ok/868cddebeb9acc8ccbac6253de0<wbr>480b0</a><br>
<br>
I tried removing the llvm.frameaddres calls but that's not it, where can<br>
I start looking for what my mistake here is? Code seems to verify just<br>
fine.<br>
<br>
<br>
; #0 0x00e1afe8 llvm::X86FrameLowering::getFra<wbr>meIndexReference(class<br>
llvm::MachineFunction const &,int,unsigned int &)const<br>
c:\p\llvm\llvm\lib\target\x86\<wbr>x86framelowering.cpp:1672:0<br>
; #1 0x00f99010 llvm::WinException::getFrameIn<wbr>dexOffset(int,struct<br>
llvm::WinEHFuncInfo const &)<br>
c:\p\llvm\llvm\lib\codegen\asm<wbr>printer\winexception.cpp:320:0<br>
; #2 0x00f97f75 llvm::WinException::emitCXXFra<wbr>meHandler3Table(class<br>
llvm::MachineFunction const *,bool)<br>
c:\p\llvm\llvm\lib\codegen\asm<wbr>printer\winexception.cpp:805:0<br>
; #3 0x00f98e77 llvm::WinException::endFunctio<wbr>n(class<br>
llvm::MachineFunction const *)<br>
c:\p\llvm\llvm\lib\codegen\asm<wbr>printer\winexception.cpp:146:0<br>
; #4 0x00f685f7 llvm::AsmPrinter::EmitFunction<wbr>Body(void)<br>
c:\p\llvm\llvm\lib\codegen\asm<wbr>printer\asmprinter.cpp:978:0<br>
; #5 0x00d307fa llvm::X86AsmPrinter::runOnMach<wbr>ineFunction(class<br>
llvm::MachineFunction &)<br>
c:\p\llvm\llvm\lib\target\x86\<wbr>x86asmprinter.cpp:73:0<br>
; #6 0x01021d1b llvm::MachineFunctionPass::run<wbr>OnFunction(class<br>
llvm::Function &) c:\p\llvm\llvm\lib\codegen\mac<wbr>hinefunctionpass.cpp:64:0<br>
; #7 0x011a8f40 llvm::FPPassManager::runOnFunc<wbr>tion(class llvm::Function<br>
&) c:\p\llvm\llvm\lib\ir\legacypa<wbr>ssmanager.cpp:1522:0<br>
; #8 0x011a9083 llvm::FPPassManager::runOnModu<wbr>le(class llvm::Module &)<br>
c:\p\llvm\llvm\lib\ir\legacypa<wbr>ssmanager.cpp:1542:0<br>
; #9 0x011a9202 `anonymous namespace'::MPPassManager::run<wbr>OnModule<br>
c:\p\llvm\llvm\lib\ir\legacypa<wbr>ssmanager.cpp:1599:0<br>
; #10 0x011a8b49 llvm::legacy::PassManagerImpl:<wbr>:run(class llvm::Module<br>
&) c:\p\llvm\llvm\lib\ir\legacypa<wbr>ssmanager.cpp:1703:0<br>
; #11 0x00aee750 compileModule c:\p\llvm\llvm\tools\llc\llc.c<wbr>pp:508:0<br>
; #12 0x00af2e2a main c:\p\llvm\llvm\tools\llc\llc.c<wbr>pp:273:0<br>
; #13 0x015b7e28 _scrt_common_main_seh<br>
f:\dd\vctools\crt\vcstartup\sr<wbr>c\startup\exe_common.inl:253:0<br>
; #14 0x769e62c4 (C:\WINDOWS\System32\KERNEL32.<wbr>DLL+0x162c4)<br>
; #15 0x772f0609 (C:\WINDOWS\SYSTEM32\ntdll.dll<wbr>+0x60609)<br>
; #16 0x772f05d4 (C:\WINDOWS\SYSTEM32\ntdll.dll<wbr>+0x605d4)<br>
<br>
<br>
bitcode: <a href="https://gist.github.com/carlokok/868cddebeb9acc8ccbac6253de0480b0" rel="noreferrer" target="_blank">https://gist.github.com/carlok<wbr>ok/868cddebeb9acc8ccbac6253de0<wbr>480b0</a><br>
<br>
</blockquote>
<br>
-- <br>
Carlo Kok<br>
RemObjects Software<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>