From owner-freebsd-ppc@freebsd.org Wed Aug 31 01:17:35 2016 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E277EBBCE48 for ; Wed, 31 Aug 2016 01:17:35 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-35.reflexion.net [208.70.210.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98A48CD9 for ; Wed, 31 Aug 2016 01:17:34 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 31752 invoked from network); 31 Aug 2016 01:18:17 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 31 Aug 2016 01:18:17 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.00.0) with SMTP; Tue, 30 Aug 2016 21:17:26 -0400 (EDT) Received: (qmail 27438 invoked from network); 31 Aug 2016 01:17:25 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 31 Aug 2016 01:17:25 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.104] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 821F9B1E001; Tue, 30 Aug 2016 18:17:27 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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] Date: Tue, 30 Aug 2016 18:17:32 -0700 References: To: FreeBSD Toolchain , FreeBSD PowerPC ML Message-Id: <13C54407-8758-41E8-BBDB-4C3574D05C61@dsl-only.net> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 01:17:36 -0000 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: 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.