From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 989E9385828B; Fri, 23 Sep 2022 09:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 989E9385828B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663924556; bh=Vcf9D1QWm8xlv7JHm6ixr2Ah4hDjYFqDm/ZeUiIC8Xk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IZ0Oe379N1MuC2ZouqueodE5jSMYsU8v7OuU8GAOvxPMzdSF3A0YWGCDnHtfMRoqq GFSem0LyrJfv9IaNEOuvaLDgcSvI8lphfvaw79i9/H2aFcY4s1kf1+JrPnB5pgdPl1 myxMEVoHcdYJsAYVIw6CReGBOK5vU5beK7RbgWY8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106981] [10/11/12/13 Regression][OpenACC][OpenMP] ICE in decompose, at wide-int.h:984 with '#pragma omp/acc atomic capture' Date: Fri, 23 Sep 2022 09:15:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-invalid-code, openacc, 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: 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=3D106981 --- Comment #7 from Jakub Jelinek --- (In reply to Tobias Burnus from comment #6) > (In reply to Jakub Jelinek from comment #5) >=20 > > The fix could be either partially backport what C++ FE did in > > --- gcc/c/c-typeck.cc.jj 2022-09-23 09:02:56.525318361 +0200 > > +++ gcc/c/c-typeck.cc 2022-09-23 10:33:06.596467788 +0200 >=20 > > + if (CONSTANT_CLASS_P (t1) && !comptypes (TREE_TYPE (t1), TREE_TYPE (= t2))) > > + return false; >=20 > Maybe. Though I think we still need something like my: >=20 > + if (n > TREE_OPERAND_LENGTH (t2)) > + return false; >=20 > (With ">" not ">=3D" as I accidentally had.) > Given that=20 > if (!c_tree_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i))) > does not make sense when exceeding the operand length! I don't understand. We have there: int i, n =3D TREE_OPERAND_LENGTH (t1); switch (code1) { case PREINCREMENT_EXPR: case PREDECREMENT_EXPR: case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: n =3D 1; break; case ARRAY_REF: n =3D 2; break; default: break; } if (TREE_CODE_CLASS (code1) =3D=3D tcc_vl_exp && n !=3D TREE_OPERAND_LENGTH (t2)) return false; and know that code1 =3D=3D code2. So, except for tcc_vl_exp like CALL_EXPR, TREE_OPERAND_LENGTH (t1) =3D=3D TREE_OPERAND_LENGTH (t2) and n is in most cases equal to that too, except for the pre/post in/decrements (which have length 2) and ARRAY_REF which has length 4 and we use a smaller number.=