[Bug c++/88256] [8/9 Regression] ICE: Segmentation fault (in make_ssa_name_fn) with VLA cast, C++ FE missing DECL_EXPRs

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 2 21:26:00 GMT 2020


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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:f137a7c6b122e524294fb792bb97d5f3b0600c4f

commit r9-8322-gf137a7c6b122e524294fb792bb97d5f3b0600c4f
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Mar 2 14:42:47 2020 -0500

    c++: Fix cast to pointer to VLA.

    The C front-end fixed this issue in r257620 by adding a DECL_EXPR from
    grokdeclarator.  We don't have an easy way to do that in the C++ front-end,
    but it works fine to create and prepend a DECL_EXPR when we are
genericizing
    the NOP_EXPR for the cast.

    The C patch wraps the DECL_EXPR in a BIND_EXPR, but that seems unnecessary
    in C++; this is just a hook to run gimplify_type_sizes, we aren't actually
    declaring anything that we need to worry about scoping for.

    gcc/cp/ChangeLog
    2020-03-02  Jason Merrill  <jason@redhat.com>

        PR c++/88256
        * cp-gimplify.c (predeclare_vla): New.
        (cp_genericize_r) [NOP_EXPR]: Call it.


More information about the Gcc-bugs mailing list