<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Ping?<div><br></div><div>Thanks,<br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div style=""><div>On Apr 9, 2014, at 4:06 PM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Eric and Jim,<div><br></div><div>@Eric, I do not know if you are the right person to review this, but compact frame information looks related enough to dwarf emission that I assume you know :).</div><div><br></div><div>The attached patch fixes an assertion failure[1] in the assembler when a .cfi_startproc is used before a function (or more generally a symbol) is defined.</div><div><br></div><div>Thanks for your reviews/feedbacks.</div><div><br></div><div>** Context **</div><div><br></div><div>Currently the assembler crashes when emitting the compact unwind information if the input assembly file starts with a .cfi_startproc directive before any symbol has been defined.</div><div><br></div><div>I am not a CFI expert, but that does not look right to me to use a .cfi_startproc directive without having started the related function!</div><div><br></div><div><br></div><div>** Proposed Solution **</div><div><br></div><div>Issue a backend fatal error if a frame is started whereas no symbol is defined. Although this diagnostic method is not pretty, this is how all cfi related errors are handled (e.g., looks for No open frame).</div><div><br></div><div>The patch also modifies a few test cases to define a function before .cfi_startproc is used.</div><div>I.e., test cases like this:</div><div>.cfi_startproc</div><div><br></div><div>Looks like this now:</div><div>_proc:</div><div>.cfi_startproc</div><div><br></div><div>If that does not make sense, please let me know!</div><div><br></div><div><<a href="rdar://problem/15939159">rdar://problem/15939159</a>></div><div><br></div><div>[1]</div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Assertion failed: (Symbol), function MCSymbolRefExpr, file include/llvm/MC/MCExpr.h, line 273.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">0  llvm-mc                  0x0000000109d85e3e llvm::sys::PrintStackTrace(__sFILE*) + 46</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">1  llvm-mc                  0x0000000109d8614b PrintStackTraceSignalHandler(void*) + 27</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">2  llvm-mc                  0x0000000109d864c8 SignalHandler(int) + 408</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">3  libsystem_platform.dylib 0x00007fff8f8895aa _sigtramp + 26</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">4  libsystem_platform.dylib 0x00007f9452c05338 _sigtramp + 3275210152</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">5  llvm-mc                  0x0000000109d8617b raise + 27</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">6  llvm-mc                  0x0000000109d86232 abort + 18</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">7  llvm-mc                  0x0000000109d86211 __assert_rtn + 129</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">8  llvm-mc                  0x0000000109d019bf llvm::MCSymbolRefExpr::MCSymbolRefExpr(llvm::MCSymbol const*, llvm::MCSymbolRefExpr::VariantKind, llvm::MCAsmInfo const*) + 143</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">9  llvm-mc                  0x0000000109d0081b llvm::MCSymbolRefExpr::MCSymbolRefExpr(llvm::MCSymbol const*, llvm::MCSymbolRefExpr::VariantKind, llvm::MCAsmInfo const*) + 43</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">10 llvm-mc                  0x0000000109cfda56 llvm::MCSymbolRefExpr::Create(llvm::MCSymbol const*, llvm::MCSymbolRefExpr::VariantKind, llvm::MCContext&) + 134</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">11 llvm-mc                  0x0000000109b79df4 llvm::MCSymbolRefExpr::Create(llvm::MCSymbol const*, llvm::MCContext&) + 36</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">12 llvm-mc                  0x0000000109d16f85 llvm::MCStreamer::EmitSymbolValue(llvm::MCSymbol const*, unsigned int) + 69</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">13 llvm-mc                  0x0000000109ceb7ca (anonymous namespace)::FrameEmitterImpl::EmitCompactUnwind(llvm::MCStreamer&, llvm::MCDwarfFrameInfo const&) + 314</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">14 llvm-mc                  0x0000000109ceb2d6 llvm::MCDwarfFrameEmitter::Emit(llvm::MCStreamer&, llvm::MCAsmBackend*, bool, bool) + 470</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">15 llvm-mc                  0x0000000109d1b1cf llvm::MCStreamer::EmitFrames(llvm::MCAsmBackend*, bool) + 95</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">16 llvm-mc                  0x0000000109d04152 (anonymous namespace)::MCMachOStreamer::FinishImpl() + 66</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">17 llvm-mc                  0x0000000109d1b2df llvm::MCStreamer::Finish() + 159</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">18 llvm-mc                  0x0000000109c30582 (anonymous namespace)::AsmParser::Run(bool, bool) + 2546</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">19 llvm-mc                  0x000000010995457c AssembleInput(char const*, llvm::Target const*, llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo&, llvm::MCSubtargetInfo&, llvm::MCInstrInfo&) + 940</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">20 llvm-mc                  0x0000000109952461 main + 9457</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">21 libdyld.dylib            0x00007fff959e65fd start + 1</div></div><div><br></div><div>Cheers,<br><div apple-content-edited="true">
<div style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">-Quentin</div>

</div>
</div></div><span><cfi_startproc.patch></span><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></body></html>