This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fallback to DWARF when trying to emit compact unwind info with multiple CFA offset adjustments
ClosedPublic

Authored by chill on Mar 4 2022, 11:47 AM.

Details

Summary

Instead of asserting, fallback to emitting DWARF unwind info when an
attempt is made to output compact unwind info for a function with
multiple adjustments to the CFA offset.

Multiple adjustments of SP are common and with instruction precise
unwind tables these may translate into multiple .cfi_def_cfa_offset
directives.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1302998

Diff Detail

Event Timeline

chill created this revision.Mar 4 2022, 11:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 11:47 AM
chill requested review of this revision.Mar 4 2022, 11:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 11:47 AM
dmgreen accepted this revision.Mar 21 2022, 1:10 AM
dmgreen added a subscriber: dmgreen.

Looks OK, compared to what the other code does here. LGTM

This revision is now accepted and ready to land.Mar 21 2022, 1:10 AM
This revision was landed with ongoing or failed builds.Mar 23 2022, 8:34 AM
This revision was automatically updated to reflect the committed changes.

I don't think this is the ideal fix. We don't do asynchronous unwind on Darwin, and for synchronous cases it looked to me like the final stack update was still correct. So rather than pessimizing lots and lots of functions' unwind tables (a significant size impact), I think it's better to simply disable the assertion: https://reviews.llvm.org/D121116 (I'll update it for the status quo with tests on Monday).