summaryrefslogtreecommitdiff
path: root/gcc/gimplify.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-01-10 13:46:57 -0500
committerJason Merrill <jason@gcc.gnu.org>2020-01-10 13:46:57 -0500
commit640b23d7ff5f3fad005dcbfb04a36e27000fc150 (patch)
tree61f43978030d8d42b472bfc871aed800deaa0e66 /gcc/gimplify.h
parent9b0700571fe390afcca32dcb3b2122640e628c95 (diff)
downloadgcc-640b23d7ff5f3fad005dcbfb04a36e27000fc150.tar.gz
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
Diffstat (limited to 'gcc/gimplify.h')
-rw-r--r--gcc/gimplify.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimplify.h b/gcc/gimplify.h
index 9f4e33232e3..9bb8c67b593 100644
--- a/gcc/gimplify.h
+++ b/gcc/gimplify.h
@@ -62,6 +62,7 @@ extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq * = NULL,
extern void declare_vars (tree, gimple *, bool);
extern void gimple_add_tmp_var (tree);
extern void gimple_add_tmp_var_fn (struct function *, tree);
+extern void copy_if_shared (tree *, void * = NULL);
extern tree unshare_expr (tree);
extern tree unshare_expr_without_location (tree);
extern tree voidify_wrapper_expr (tree, tree);