From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09C343858D3C; Sat, 23 Dec 2023 02:42:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09C343858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703299371; bh=YMcrhzjOeJ41UnoriFtDgjgG6l3rxepAgAcrbqWmXHU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DzBBfhDEWeRbkVt/Y0eVgj+rAQuMxejL/Nhg790f3ntFCnNxmWlDyemjwtWNB+aFm e0zHvTV3HPGsCGhdLnQJhM8hXYBzVQpitavfW4IU19eTmWG7GXqTN4zRl1VdtuBiFs MJRHkyI8x5LHG2qKMFK9SfF+E/XBcEh+lIRahL0A= From: "hp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113109] [14 Regression] g++ EH tests fail at execution time for cris-elf after r14-6674-g4759383245ac97 Date: Sat, 23 Dec 2023 02:42:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: EH, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hp at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113109 --- Comment #3 from Hans-Peter Nilsson --- It's __builtin_eh_return( that's miscompiled, such that the "handler" isn't installed and the calling function will return to its caller instead of the handler. For the example below: void f(__UINTPTR_TYPE__ p1, void *p2) { __builtin_eh_return(p1, p2); } ...there's a tell-tale diff between 6673 and 6674 in generated assembly cod= e at -O2: @@ -23,7 +23,6 @@ _f: move.d $r13,[$sp] .LCFI5: move.d $r10,$r9 - move.d $r11,[$sp+16] move.d [$sp+],$r13 move.d [$sp+],$r12 move.d [$sp+],$r11 cris.h defines EH_RETURN_HANDLER_RTX (as a call to cris_return_addr_rtx yielding) gen_rtx_MEM (Pmode, plus_constant (Pmode, virtual_incoming_args_r= tx, -4)). I'm "guessing" that the problem with the patch, is that anything any port stores through a pointer based on virtual_incoming_args_rtx before returnin= g, is now eliminated.=