From owner-freebsd-bugs@freebsd.org Sun Feb 28 00:20:27 2016 Return-Path: Delivered-To: freebsd-bugs@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 A4527AB5AFC for ; Sun, 28 Feb 2016 00:20:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 942A2E46 for ; Sun, 28 Feb 2016 00:20:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1S0KRVm038268 for ; Sun, 28 Feb 2016 00:20:27 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 207325] projects/clang380-import for TARGET_ARCH=powerpc : c++ exceptions cause SEGV (9 line program); powerpc64 __builtin_dwarf_cfa() issue as well Date: Sun, 28 Feb 2016 00:20:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2016 00:20:27 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207325 --- Comment #8 from Mark Millard --- (In reply to Mark Millard from comment #6) # more builtin_dwarf_cfa.cpp=20 extern void g(void*); void f() { g(__builtin_dwarf_cfa()); } In a TARGET_ARCH=3Dpowerpc64 context: # clang++ -c -g -std=3Dc++11 -Wall -pedantic builtin_dwarf_cfa.cpp # /usr/local/bin/objdump -d --prefix-addresses builtin_dwarf_cfa.o builtin_dwarf_cfa.o: file format elf64-powerpc-freebsd Disassembly of section .text: 0000000000000000 <._Z1fv> mflr r0 0000000000000004 <._Z1fv+0x4> std r31,-8(r1) 0000000000000008 <._Z1fv+0x8> std r0,16(r1) 000000000000000c <._Z1fv+0xc> stdu r1,-128(r1) 0000000000000010 <._Z1fv+0x10> mr r31,r1 0000000000000014 <._Z1fv+0x14> mr r3,r31 0000000000000018 <._Z1fv+0x18> bl 0000000000000018 <._Z1fv+0x18> 000000000000001c <._Z1fv+0x1c> nop 0000000000000020 <._Z1fv+0x20> addi r1,r1,128 0000000000000024 <._Z1fv+0x24> ld r0,16(r1) 0000000000000028 <._Z1fv+0x28> ld r31,-8(r1) 000000000000002c <._Z1fv+0x2c> mtlr r0 0000000000000030 <._Z1fv+0x30> blr ... r3 does not point to the boundary with the caller's stack frame. By contrast for g++49: # g++49 -c -g -std=3Dc++11 -Wall -pedantic builtin_dwarf_cfa.cpp # /usr/local/bin/objdump -d --prefix-addresses builtin_dwarf_cfa.o | more builtin_dwarf_cfa.o: file format elf64-powerpc-freebsd Disassembly of section .text: 0000000000000000 <._Z1fv> mflr r0 0000000000000004 <._Z1fv+0x4> std r0,16(r1) 0000000000000008 <._Z1fv+0x8> std r31,-8(r1) 000000000000000c <._Z1fv+0xc> stdu r1,-128(r1) 0000000000000010 <._Z1fv+0x10> mr r31,r1 0000000000000014 <._Z1fv+0x14> addi r9,r31,128 0000000000000018 <._Z1fv+0x18> mr r3,r9 000000000000001c <._Z1fv+0x1c> bl 000000000000001c <._Z1fv+0x1c> 0000000000000020 <._Z1fv+0x20> nop 0000000000000024 <._Z1fv+0x24> addi r1,r31,128 0000000000000028 <._Z1fv+0x28> ld r0,16(r1) 000000000000002c <._Z1fv+0x2c> mtlr r0 0000000000000030 <._Z1fv+0x30> ld r31,-8(r1) 0000000000000034 <._Z1fv+0x34> blr 0000000000000038 <._Z1fv+0x38> .long 0x0 000000000000003c <._Z1fv+0x3c> .long 0x90001 0000000000000040 <._Z1fv+0x40> lwz r0,1(r1) r3 does point to the boundary with the caller's stack frame. For TARGET_ARCH=3Dpowerpc, clang 3.8.0 first: # clang++ -c -g -std=3Dc++11 -Wall -pedantic builtin_dwarf_cfa.cpp # /usr/local/bin/objdump -d --prefix-addresses builtin_dwarf_cfa.o builtin_dwarf_cfa.o: file format elf32-powerpc-freebsd Disassembly of section .text: 00000000 <_Z1fv> mflr r0 00000004 <_Z1fv+0x4> stw r31,-4(r1) 00000008 <_Z1fv+0x8> stw r0,4(r1) 0000000c <_Z1fv+0xc> stwu r1,-16(r1) 00000010 <_Z1fv+0x10> mr r31,r1 00000014 <_Z1fv+0x14> mr r3,r31 00000018 <_Z1fv+0x18> bl 00000018 <_Z1fv+0x18> 0000001c <_Z1fv+0x1c> addi r1,r1,16 00000020 <_Z1fv+0x20> lwz r0,4(r1) 00000024 <_Z1fv+0x24> lwz r31,-4(r1) 00000028 <_Z1fv+0x28> mtlr r0 0000002c <_Z1fv+0x2c> blr Then g++5 (5.3): # g++5 -c -g -std=3Dc++11 -Wall -pedantic builtin_dwarf_cfa.cpp # /usr/local/bin/objdump -d --prefix-addresses builtin_dwarf_cfa.o builtin_dwarf_cfa.o: file format elf32-powerpc-freebsd Disassembly of section .text: 00000000 <_Z1fv> stwu r1,-16(r1) 00000004 <_Z1fv+0x4> mflr r0 00000008 <_Z1fv+0x8> stw r0,20(r1) 0000000c <_Z1fv+0xc> stw r31,12(r1) 00000010 <_Z1fv+0x10> mr r31,r1 00000014 <_Z1fv+0x14> addi r9,r31,16 00000018 <_Z1fv+0x18> mr r3,r9 0000001c <_Z1fv+0x1c> bl 0000001c <_Z1fv+0x1c> 00000020 <_Z1fv+0x20> nop 00000024 <_Z1fv+0x24> addi r11,r31,16 00000028 <_Z1fv+0x28> lwz r0,4(r11) 0000002c <_Z1fv+0x2c> mtlr r0 00000030 <_Z1fv+0x30> lwz r31,-4(r11) 00000034 <_Z1fv+0x34> mr r1,r11 00000038 <_Z1fv+0x38> blr --=20 You are receiving this mail because: You are the assignee for the bug.=