From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A55E3383D820; Mon, 30 May 2022 03:36:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A55E3383D820 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105635] [12 Regression] ICE in gimple_parm_array_size, at pointer-query.cc:592 since r12-6606-g9d6a0f388eb048f8 Date: Mon, 30 May 2022 03:36:44 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 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: Mon, 30 May 2022 03:36:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105635 --- Comment #5 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:7b88f9b8881b7653b5a834da1b2b8fda463e61c0 commit r12-8432-g7b88f9b8881b7653b5a834da1b2b8fda463e61c0 Author: Jakub Jelinek Date: Thu May 19 11:56:21 2022 +0200 pointer-query: Fix ICE with non-pointer param [PR105635] The gimple_parm_array_size function comment talks about pointe paramete= rs but doesn't actually verify it, it checks whether an attribute is prese= nt on the function and then just uses TREE_TYPE (TREE_TYPE (var)) which assumes a pointer type (or in theory could work for ARRAY_TYPE but c-family languages which only have that attribute will never have ARRAY_TYPE parameters; and for VECTOR_TYPE/COMPLEX_TYPE it would mean something qu= ite different). So, this patch punts early if var doesn't have pointer/reference type. 2022-05-19 Jakub Jelinek PR c/105635 * pointer-query.cc (gimple_parm_array_size): Return NULL if var doesn't have pointer or reference type. * gcc.dg/pr105635.c: New test. (cherry picked from commit 3b4daa0b3c3d8eb2ac3b40ad6898f314ed4d7919)=