From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 24FDA3858D33; Thu, 4 Jan 2024 04:19:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24FDA3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704341961; bh=bRAFhBmVWsTV54E4UasfV33raKH8lXCmeVqlNslZA3I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aFsFRs+ToG0W8Ze6SbZMk67Kk0gUwT6cQzY9TLP7rBUZoyZvEfHayO9LKahsdMwVM pMLUZsu6NtCQONf7VOK5zQckNrpnWOCsvkcIe6oHe91QC2MUEs6V/6Und9HyzwAY5E W0+jLAFVxTA6+nsYEBbAJjbUifMgPoNnnp1EIAf4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113228] [14 Regression] ICE: recalculate_side_effects, at gimplify.cc:3347 Date: Thu, 04 Jan 2024 04:19:20 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D113228 --- Comment #6 from Andrew Pinski --- What match is doing is correct, what reassoc is doing looks to be ok, but t= he gimplifier just falls over on `SSA_NAME !=3D 0`. This fixes the ICE but I don't understand how the gimplifier was handling SSA_NAME before if it ever was, the code mentioned here has not changed sin= ce the tuples was merged in: ``` diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 15b540646c2..0cbe159b383 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -3304,6 +3304,9 @@ recalculate_side_effects (tree t) int len =3D TREE_OPERAND_LENGTH (t); int i; + if (code =3D=3D SSA_NAME) + return; + switch (TREE_CODE_CLASS (code)) { case tcc_expression: @@ -18253,7 +18256,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, case SSA_NAME: /* Allow callbacks into the gimplifier during optimization. */ ret =3D GS_ALL_DONE; - break; + goto dont_recalculate; case OMP_PARALLEL: gimplify_omp_parallel (expr_p, pre_p); ```=