From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA2523858C00; Thu, 23 Feb 2023 15:55:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA2523858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677167711; bh=A667eoDdLtOgPIkbAAIXt02AhJ98GpD1DzgI2TnveSE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oChGy19K4nhltGnJvSnOUqolMRssldMSyguyaf82g6cKFX0VeLnFjjGZvKlLxUwIt TthExhaJeAioSENV5vWn7fONf2OiVWoiEqPRoQ0DzYVOK9if1Wp6wZIEW73Dyl3jCo q/fR9aHNwPmZ4xQw3LpbcnwEJSY7/hwQbRneRtcQ= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108854] [10/11/12/13 Regression] tbb-2021.8.0 fails on i686-linux (32-bit), internal compiler error: in expand_expr_real_1, at expr.c:10281 since r10-4511-g6cf67b62c8cda035dccac Date: Thu, 23 Feb 2023 15:55:09 +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: 11.3.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D108854 --- Comment #11 from Jakub Jelinek --- I think the problem is that duplicate_thunk_for_node when copying the FUNCTION_DECL node doesn't also copy DECL_ARGUMENTS (unless some changes to= the arguments are needed). --- gcc/cgraphclones.cc.jj 2023-02-22 20:50:27.417519830 +0100 +++ gcc/cgraphclones.cc 2023-02-23 16:02:29.653090584 +0100 @@ -218,7 +218,17 @@ duplicate_thunk_for_node (cgraph_node *t body_adj.modify_formal_parameters (); } else - new_decl =3D copy_node (thunk->decl); + { + new_decl =3D copy_node (thunk->decl); + for (tree *arg =3D &DECL_ARGUMENTS (new_decl); + *arg; arg =3D &DECL_CHAIN (*arg)) + { + tree next =3D DECL_CHAIN (*arg); + *arg =3D copy_node (*arg); + DECL_CONTEXT (*arg) =3D new_decl; + DECL_CHAIN (*arg) =3D next; + } + } gcc_checking_assert (!DECL_STRUCT_FUNCTION (new_decl)); gcc_checking_assert (!DECL_INITIAL (new_decl)); seems to fix the ICE.=