From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 62F84384B0C1; Tue, 21 Apr 2020 14:26:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62F84384B0C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587479202; bh=7mOtuvDZSYgKJQmdOgsKVXpD+2o8O14VTU2e8Y49jPA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ld//0VCMzMQxIQJncVvySRlrgtg1XCP4pMqtS0LXbxYST3ui/0PUkJre1FYAUvd2Y 5FwpHdAvw3i8NTcZp6qtZ+sFfrxI3S9NeqERZaHkyiIgRm5LRiFAR1OBJ3Q8/QZqZS yZWCyCouf04tT5DJLZMy0JxlThHBv8wYfhvwZav0= From: "nsz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94515] aarch64: broken unwind information for pac-ret Date: Tue, 21 Apr 2020 14:26:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: EH, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: nsz at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nsz at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 14:26:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94515 --- Comment #1 from nsz at gcc dot gnu.org --- i had a fix but it's not enough, so here is another test case: __attribute__((noreturn)) void unwind(void); int bar(void); int global; int foo(int x) { if (x=3D=3D1) return 2; int y =3D bar(); if (y > global) global=3Dy; if (y=3D=3D3) unwind(); return 0; } -O2 -S -mbranch-protection=3Dpac-ret the asm: foo: .cfi_startproc cmp w0, 1 beq .L4 hint 25 // paciasp .cfi_window_save //// pauth on stp x29, x30, [sp, -16]! .cfi_def_cfa_offset 16 .cfi_offset 29, -16 .cfi_offset 30, -8 mov x29, sp bl bar mov w1, w0 adrp x2, .LANCHOR0 ldr w0, [x2, #:lo12:.LANCHOR0] cmp w0, w1 blt .L11 .L3: mov w0, 0 cmp w1, 3 beq .L12 ldp x29, x30, [sp], 16 .cfi_remember_state .cfi_restore 30 .cfi_restore 29 .cfi_def_cfa_offset 0 hint 29 // autiasp .cfi_window_save //// pauth off ret .p2align 2,,3 .L11: .cfi_restore_state //// pauth on str w1, [x2, #:lo12:.LANCHOR0] b .L3 .p2align 2,,3 .L4: .cfi_def_cfa_offset 0 .cfi_restore 29 .cfi_restore 30 mov w0, 2 //// pauth should be off but it's on=20 ret .L12: .cfi_def_cfa_offset 16 .cfi_offset 29, -16 .cfi_offset 30, -8 bl unwind .cfi_endproc=