From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 346D23858D39; Wed, 1 Feb 2023 14:24:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 346D23858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675261491; bh=JFbHMzooLD9N/txsbp1/8Mi9nFKvWzW21SE0a9mpsCY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OSJ6qkHA5A1taNYOxMWgIx5RFKHFROBCzZoTAA/AgIZo/MF1GjZ+5h2WvulpH4fih pNfwfgjceCw2+cr3ne2ShbGfXJI8/HZcX84mq56pBWa6Wv1Iz/OBXMNi1f1JIOfzeN JBwxyMb1jC1ZU5FLTLrO+VebZ8xZArd1LhZpGSS0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108435] [13 Regression] ICE in as_a, at is-a.h:242 since r13-142-g705bcedf6eae2d7c Date: Wed, 01 Feb 2023 14:24: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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 13.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=3D108435 --- Comment #4 from Jakub Jelinek --- I think the problem is that normally when gimplifying OMP_CLAUSE_LASTPRIVATE_STMT we force a BIND_EXPR around it: push_gimplify_context (); if (TREE_CODE (OMP_CLAUSE_LASTPRIVATE_STMT (c)) !=3D BIND_EXP= R) { tree bind =3D build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL); TREE_SIDE_EFFECTS (bind) =3D 1; BIND_EXPR_BODY (bind) =3D OMP_CLAUSE_LASTPRIVATE_STMT (c); OMP_CLAUSE_LASTPRIVATE_STMT (c) =3D bind; } gimplify_and_add (OMP_CLAUSE_LASTPRIVATE_STMT (c), &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)); pop_gimplify_context (gimple_seq_first_stmt (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))); (similarly for linear), but in this case we do it only conditionally - if temporaries are needed: if (OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_LASTPRIVATE) seq =3D &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c); else seq =3D &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c); push_gimplify_context (); gimplify_assign (decl, t, seq); gimple *bind =3D NULL; if (gimplify_ctxp->temps) { bind =3D gimple_build_bind (NULL_TREE, *seq, NULL_TREE); *seq =3D NULL; gimplify_seq_add_stmt (seq, bind); } pop_gimplify_context (bind); So, either we do it also unconditionally during gimplify.cc, or in tree-nested.cc add it later.=