From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23A023858413; Wed, 23 Mar 2022 07:28:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23A023858413 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: Wed, 23 Mar 2022 07:28:19 +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: 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: Wed, 23 Mar 2022 07:28:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104970 --- Comment #9 from Jakub Jelinek --- If that works, please add at least a check that TREE_CODE (typesize) =3D=3D INTEGER_CST (or perhaps also POLY_INT_CST) if it really needs to be multipl= ied by the size of what the pointer points to. In which case the question is a= lso what should happen for void * parameters, the code right now doesn't multip= ly it by anything in that case: if (typesize) sz =3D size_binop (MULT_EXPR, sz, typesize); but IMHO it should give up for arbitrary incomplete types and just handle t= he void * case (so punt on !typesize unless TREE_CODE (TREE_TYPE (TREE_TYPE (parm))) =3D=3D VOID_TYPE?). The documentation says: "The optional @var{size-index} positional argument denotes a function argument of integer type that specifies the maximum size of the access. The size is the number of elements of the type referenced by @var{ref-index= }, or the number of bytes when the pointer type is @code{void*}." so if you have struct S; void foo (struct S *p, int sz) with access attribu= te I think you just want to punt.=