Date: Tue, 30 Aug 2016 18:17:32 -0700 From: Mark Millard <markmi@dsl-only.net> To: FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: From llvm: Fwd: [Bug 26856] clang 3.8.0/powerpc/powerpc64's _Unwind_RaiseException code generation has messed up r31 (frame pointer) save/restore code (SEGV's can result) [another issue reported fixed, via llvm r280188] Message-ID: <13C54407-8758-41E8-BBDB-4C3574D05C61@dsl-only.net> References: <bug-26856-7604-4taR3C2xLm@http.llvm.org/bugs/>
next in thread | previous in thread | raw e-mail | index | archive | help
The below notice from Hal Finkel [via llvm's bugzilla] indicates that at = least part of llvm bug 26856 for powerpc64's is expected to have been = fixed by r280188 (likely on trunk?). 26856 was one of my reports that had independent confirmation back when = I submitted it. Some of the quote below is from the exchange about the = problems from back then. =3D=3D=3D Mark Millard markmi at dsl-only.net Begin forwarded message: From: bugzilla-daemon at llvm.org Subject: [Bug 26856] clang 3.8.0/powerpc/powerpc64's = _Unwind_RaiseException code generation has messed up r31 (frame pointer) = save/restore code (SEGV's can result) Date: August 30, 2016 at 5:54:45 PM PDT To: <markmi at dsl-only.net> Comment # 11 on bug 26856 from Hal Finkel (In reply to comment #6 ) ... >=20 > 2) In some scenarios, registers may be spilled/restored twice to the = stack.=20 > This happens because while most of the spilling happens in > PPCFrameLowering::spillCalleeSavedRegisters, a few selected registers = are > also spilled in PPCFrameLowering::emitPrologue. Those registers are = the > frame pointer, base pointer, PIC base pointer, link register, and = condition > code register. For the latter two, code ensures that they can never = be > spilled in both places (for CR, there is extra code in > spillCalleeSavedRegisters; for LR, the register is removed from = SavedRegs in > determineCalleeSaves). >=20 > However, for FP, BP, and PBP, nothing ensures the registers are not = spilled > twice. It is probably *rare* for this to happen, because the register > allocator will not use those registers within the function if they're = needed > for their special purpose, but it can happen in rare cases. This = includes > the case of a system unwinder routine that uses __builtin_unwind_init, = but > could also include other routines that clobber one of those registers, = e.g. > the following case: >=20 > void func (void); >=20 > void test (void) > { > func (); > asm ("nop" : : : "31"); > } r280188 should address the spilling-twice problem. You are receiving this mail because: =E2=80=A2 You reported the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13C54407-8758-41E8-BBDB-4C3574D05C61>