https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115242

Alisa Sireneva <me at purplesyringa dot moe> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me at purplesyringa dot moe

--- Comment #4 from Alisa Sireneva <me at purplesyringa dot moe> ---
I think this is a wider issue. The root of the problem is that
__builtin_unwind_init() affects what it _thinks_ are _callee-saved_ registers.

In this bug, the compiler thinks a register doesn't exist when it does. But
it's also possible that the compiler thinks a register is caller-saved while
it's actually callee-saved, due to differences in ABI between libgcc_s and user
code (as reproduced e.g. on x64 by throwing from __attribute__((ms_abi)), but
should be possible with plain forced unwinding too).

To me it sounds like __builtin_unwind_init() should affect all registers, not
just target-minimal or callee-saved ones. But this raises a question -- how do
you jmp to user code when all registers are user-controlled? I'm sure it's
possible to carve out a common caller-saved register or two between all common
ABIs, but it looks to me like the whole libgcc approach to unwinding is built
on shaky ground.

P.S. It looks like uw_install_context doesn't check that all registers
mentioned in DWARF can be recovered, which makes this issue harder to
reproduce. Am I missing something?

Reply via email to