This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Fix cfi_register for float registers.
ClosedPublic

Authored by danielkiss on Sep 29 2021, 10:03 AM.

Details

Reviewers
mstorsjo
Group Reviewers
Restricted Project
Commits
rG532783f9e1e6: [libunwind] Fix cfi_register for float registers.
Summary

Fixes D110144.
registers.getFloatRegister is not const in ARM therefor can't be called here.

Diff Detail

Event Timeline

danielkiss created this revision.Sep 29 2021, 10:03 AM
danielkiss requested review of this revision.Sep 29 2021, 10:03 AM

Hmm, is there something fundamental in the change from D110144 that makes it unneeded on arm specifically? If that’s the case, this is probably fine.

Register in Register is not supported by EHABI and https://docs.microsoft.com/en-us/cpp/build/arm-exception-handling.
It is feasible by DWARF but I don't think it is used on arm.

mstorsjo accepted this revision.Sep 30 2021, 2:32 PM

Register in Register is not supported by EHABI and https://docs.microsoft.com/en-us/cpp/build/arm-exception-handling.

Yeah, and this issue only arises in DwarfInstructions.hpp anyway, so it's confined to that case.

It is feasible by DWARF but I don't think it is used on arm.

Just to undestand the context on the original fix from D110144 - does anything automatically generate either of them (.cfi_undefined or .cfi_register) today, or is it only for handling cases with handwritten unwind info? Regarding "I don't think it is used on arm" - isn't it, in principle, just as plausible to want to use it in handwritten code on arm as it is on aarch64?

But I guess this change is fine. FWIW, dwarf on arm on windows is mostly a workaround since LLVM can't generate the proper windows arm unwind info (but it can for aarch64). And if I understand things correctly, Apple mostly uses sjlj on arm (except on armv7k, which is used on apple watch, where they do use dwarf/compact encoding).

This revision is now accepted and ready to land.Sep 30 2021, 2:32 PM

Adding the mailing list as subscriber, for visibility

danielkiss added a reviewer: Restricted Project.Oct 1 2021, 1:06 AM

As I know .cfi_undefined is not emitted and .cfi_register is emitted for general purpose registers only, while both appear in hand written assembly for floating point registers on aarch64.
It is possible to write assembly code that misses this support on arm with dwarf.

mstorsjo accepted this revision.Oct 1 2021, 2:50 AM

As I know .cfi_undefined is not emitted and .cfi_register is emitted for general purpose registers only, while both appear in hand written assembly for floating point registers on aarch64.
It is possible to write assembly code that misses this support on arm with dwarf.

Ok, thanks for the clarification.

With that in mind I guess this approach is fine until there's a real need for that construct on arm, on a platform that uses dwarf then.

This revision was landed with ongoing or failed builds.Oct 1 2021, 7:52 AM
This revision was automatically updated to reflect the committed changes.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 1 2021, 7:52 AM