From owner-freebsd-ppc@freebsd.org Sun Mar 6 11:48:49 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 DB625AB724C for ; Sun, 6 Mar 2016 11:48:49 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-1.reflexion.net [208.70.210.1]) (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 90E1A894 for ; Sun, 6 Mar 2016 11:48:48 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26981 invoked from network); 6 Mar 2016 11:48:45 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 6 Mar 2016 11:48:45 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sun, 06 Mar 2016 06:49:02 -0500 (EST) Received: (qmail 1110 invoked from network); 6 Mar 2016 11:49:02 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 6 Mar 2016 11:49:02 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id BF3FC1C43CC; Sun, 6 Mar 2016 03:48:45 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Bug 207736 submitted for TARGET_ARCH=powerpc (& ppc64?) clang 3.8.0 frame-pointer code generation error for _Unwind_RaiseException Message-Id: Date: Sun, 6 Mar 2016 03:48:46 -0800 To: Roman Divacky , FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2016 11:48:50 -0000 [This has been reported on llvm bugzilla: 26856.] The below causes gdb difficulties for its stack handling: more than just = exception handling is at issue. I just happened to notice it via = exception handling. Function _Unwind_RaiseException below is from a FreeBSD = TARGET_ARCH=3Dpowerpc "buildworld" using clang 3.8.0. Dump of assembler code for function _Unwind_RaiseException: 0x41b2ab80 <+0>: mflr r0 0x41b2ab84 <+4>: stw r31,-148(r1) 0x41b2ab88 <+8>: stw r30,-152(r1) 0x41b2ab8c <+12>: stw r0,4(r1) 0x41b2ab90 <+16>: stwu r1,-2992(r1) 0x41b2ab94 <+20>: mr r31,r1 . . . 0x41b2abe0 <+96>: stw r31,2844(r31) (which replaces the earlier save of the old Frame pointer R31 value with a copy of r1's current value. Note the offset relationships with the r1 adjustment: -2992+2844=3D-148) . . . 0x41b2add0 <+592>: lwz r31,2844(r31) (This restores the r1 value that resulted from the "stwu r1,-2992(r1)" = into R31.) . . . 0x41b2ae30 <+688>: lwz r31,-148(r1) (This restores the r1 value that resulted from the "stwu r1,-2992(r1)" = into R31.) . . . The wrong r31 value is present when _Unwind_RaiseException returns. But before that while _Unwind_RaiseException is active the C++ exception = handling infrastructure has been given bad r31 information for around = _Unwind_RaiseException's frame. =3D=3D=3D Mark Millard markmi at dsl-only.net