From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1B283858C50; Mon, 21 Mar 2022 11:59:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1B283858C50 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104970] [12 Regression] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b Date: Mon, 21 Mar 2022 11:59:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: siddhesh at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2022 11:59:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104970 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- Not a SSA_NAME, but no longer existing temporary. If a type has non-constant extents or bit or byte size, the vars (or SSA_NA= MEs) used in those sizes are valid just during gimplification, they can't be recovered later on when they could have been DCEd or changed in some other = way. For automatic VLAs the only thing that can be done is look up the correspon= ding __builtin_alloca_with_align and use its size argument as the size of the wh= ole object, for VLA parameters it just doesn't exist. The gimple dump here has: __attribute__((access ("^1[$ ],$0", ))) void mleye (int l, double[0:D.1990] * E) { int l.0; sizetype D.1990; bitsizetype D.1991; sizetype D.1992; l.0 =3D l; _1 =3D (long int) l.0; _2 =3D _1 + -1; _3 =3D (sizetype) _2; D.1990 =3D _3; _4 =3D (sizetype) l.0; _5 =3D (bitsizetype) _4; _6 =3D _5 * 64; D.1991 =3D _6; _7 =3D (sizetype) l.0; _8 =3D _7 * 8; D.1992 =3D _8; memset2 (E, 0, 8); } so D.1990 is the TYPE_MAX_VALUE (TYPE_DOMAIN (type)) i.e. l - 1, D.1991 is TYPE_SIZE (type) (l * 64, i.e. bit size) and D.1992 is TYPE_SIZE_= UNIT (type) (l * 8, i.e. byte size). The ssa pass turns all those into SSA_NAMEs though (and nothing updates the TYPE* values) and dse1 removes all those unused stmts. The objsz1 emergency dump shows though: _4 =3D (sizetype) l_1(D); _6 =3D D.1992 * _4; _5 =3D _6; __builtin___memset_chk (E_3(D), 0, 8, _5); so it strangely wants to multiply D.1992 (which can't be used but as sizeof (*E)) with l argument, so that is l * l * sizeof (double) if D.1992 could be used.=