https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109450

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Uecker <uec...@gcc.gnu.org>:

https://gcc.gnu.org/g:42d1612eb5c3b2ee327bc3336bfcbc43a0d0fc5b

commit r14-1143-g42d1612eb5c3b2ee327bc3336bfcbc43a0d0fc5b
Author: Martin Uecker <uec...@tugraz.at>
Date:   Sun May 21 19:32:01 2023 +0200

    Fix ICEs related to VM types in C 2/2 [PR109450]

    Size expressions were sometimes lost and not gimplified correctly,
    leading to ICEs and incorrect evaluation order.  Fix this by 1) not
    recursing pointers when gimplifying parameters, which was incorrect
    because it might access variables declared later for incomplete
    structs, and 2) adding a decl expr for variably-modified arrays
    that are pointed to by parameters declared as arrays.

            PR c/109450

            gcc/
            * function.cc (gimplify_parm_type): Remove function.
            (gimplify_parameters): Call gimplify_type_sizes.

            gcc/c/
            * c-decl.cc (add_decl_expr): New function.
            (grokdeclarator): Add decl expr for size expression in
            types pointed to by parameters declared as arrays.

            gcc/testsuite/
            * gcc.dg/pr109450-1.c: New test.
            * gcc.dg/pr109450-2.c: New test.
            * gcc.dg/vla-26.c: New test.

Reply via email to