[Bug 207736] clang 3.8.0/powerpc's _Unwind_RaiseException code generation has messed up r31 (frame pointer) save/restore code (SEGV's can result)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 6 13:58:17 UTC 2016


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

--- Comment #1 from Mark Millard <markmi at dsl-only.net> ---
I compiled a .o for TARGET_ARCH=powerpc64 via letting "buildworld" get as far
as it could and the resultant .o produced has the same sort of
r31/frame-pointer problem as powerpc for _Unwind_RaiseException: The problem
DOES occur for powerpc64.

A) r31 is stored twice to the same location, with the 2nd store destroying the
frame-pointer value that is supposed to be saved and restored for the caller.

B) r31 is restored twice from the same location.

The FreeBSD TARGET_ARCH=powerpc64 does officially use a stack red-zone on the
low-address side with officially "late" decrement and "early" increment (AIX
like). Relative to this:

A) each r31 store is on a different side of the "late" r1 decrement

and

B) each r31 restore is on a different side of the "early" r1 increment

TARGET_ARCH=powerpc gets that same relationships but the late r1 decrement and
early r1 increment are SVR4 ABI violations: SVR4'sABI does not require a
"red-zone" on the low-address side of the stack.

(To get as far as I have for powerpc "buildworld" I had to add signal red-zone
handling to my personal FreeBSD builds.)

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


More information about the freebsd-bugs mailing list