https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105635
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:3b4daa0b3c3d8eb2ac3b40ad6898f314ed4d7919 commit r13-630-g3b4daa0b3c3d8eb2ac3b40ad6898f314ed4d7919 Author: Jakub Jelinek <ja...@redhat.com> 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 parameters but doesn't actually verify it, it checks whether an attribute is present 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 quite different). So, this patch punts early if var doesn't have pointer/reference type. 2022-05-19 Jakub Jelinek <ja...@redhat.com> 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.