[Bug 207359] projects/clang380-import for TARGET_ARCH=powerpc64 via powerpc64-gcc : c++ exceptions unbounded loop in _Unwind_RaiseException (9 line program)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 6 01:36:26 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207359

--- Comment #10 from Mark Millard <markmi at dsl-only.net> ---
Here is what dwarf-2.0.0.pdf says about DW_CFA_remember_state and
DW_CFA_restore_state:


13. DW_CFA_remember_state
14. DW_CFA_restore_state
These instructions define a stack of information. Encountering the
DW_CFA_remember_state instruction means to save the rules for every register on
the current row on the stack. Encountering the DW_CFA_restore_state instruction
means to pop the set of rules off the stack and place them in the current row.
(This operation is useful for compilers that move epilogue code into the body
of a function.)



The correct interpretation of "save the rules for every register on the current
row on the stack" is to include the cfa "register" as one of those registers
that has its rules saved: it is not just processor registers that are to be
saved and restored but also the logical one(s).

dwarf-2.0.0.pdf also says:

        •       The algorithm to compute the CFA changes as you progress
through the prologue and epilogue code. (By definition, the CFA value does not
change.) 



So technically the "rules" material for the cfa "Register" need not include the
cfa value on the stack. (But pushing and popping what stays a constant value is
still correct.)


Also the cfa register is somewhat special by only having special instructions:

15. DW_CFA_def_cfa takes two unsigned LEB128 arguments representing a register
number and an offset. The required action is to define the current CFA rule to
use the provided register and offset.

16. DW_CFA_def_cfa_register takes a single unsigned LEB128 argument
representing a register number. The required action is to define the current
CFA rule to use the provided register (but to keep the old offset).

17. DW_CFA_def_cfa_offset takes a single unsigned LEB128 argument representing
an offset. The required action is to define the current CFA rule to use the
provided offset (but to keep the old register).



These only allow the resulting cfa definition rules to be of the form:
cfa=OFFSET(REG).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list