From 640b23d7ff5f3fad005dcbfb04a36e27000fc150 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 10 Jan 2020 13:46:57 -0500 Subject: 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. From-SVN: r280126 --- gcc/gimplify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 4243d3a..00d264f 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -937,7 +937,7 @@ copy_if_shared_r (tree *tp, int *walk_subtrees, void *data) /* Unshare most of the shared trees rooted at *TP. DATA is passed to the copy_if_shared_r callback unmodified. */ -static inline void +void copy_if_shared (tree *tp, void *data) { walk_tree (tp, copy_if_shared_r, data, NULL); -- cgit v1.1