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

--- Comment #17 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jan 10 18:46:57 2020
New Revision: 280126

URL: https://gcc.gnu.org/viewcvs?rev=280126&root=gcc&view=rev
Log:
        PR c++/93173 - incorrect tree sharing.

My patch for 93033 wasn't sufficient to handle all the possible sharing
introduced by split_nonconstant_init, and it occurred to me that it would
make sense to use the same unsharing technique as unshare_body, namely
copy_if_shared.

        PR c++/93033
gcc/
        * gimplify.c (copy_if_shared): No longer static.
        * gimplify.h: Declare it.
gcc/cp/
        * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
        copy_if_shared after cp_genericize_tree.
        * typeck2.c (split_nonconstant_init): Don't unshare here.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist-new3.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-gimplify.c
    trunk/gcc/cp/typeck2.c
    trunk/gcc/gimplify.c
    trunk/gcc/gimplify.h

Reply via email to