Page MenuHomePhabricator

[Mips] LLVM and GAS now use same instructions for CFA Definition. NFCI

Authored by mbrkusanin on May 14 2019, 7:34 AM.



LLVM previously used DW_CFA_def_cfa instruction in .eh_frame to set the register
and offset for current CFA rule. We change it to DW_CFA_def_cfa_register which
is the same one used by GAS that only changes the register but keeping the old

Diff Detail


Event Timeline

mbrkusanin created this revision.May 14 2019, 7:34 AM

It seems that using the instruction without offset does not affect exception
handling. Testing it on a couple of simple examples where unwinding the stack
is necessary gives correct output. This is expected since GAS uses the same
instructions. Documentation does not indicate that there are any differences
between these two instructions if we don't change the offset (in code before the
patch value passed was +0). This patch may be unnecessary but if we want to be
sure that there aren't any unexpected problems down the line we could apply it.

Now in .eh_frame instead of:

DW_CFA_def_cfa: reg29 +0

we have:

DW_CFA_def_cfa_register: reg29

DW_CFA_nop is used for padding since DW_CFA_def_cfa_register is shorter (has one
less operand).

This revision is now accepted and ready to land.May 15 2019, 2:50 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2019, 5:04 AM
Herald added a subscriber: jrtc27. · View Herald Transcript