diff options
author | Martin Liska <mliska@suse.cz> | 2020-04-16 15:39:22 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-04-16 15:39:22 +0200 |
commit | d7a65edb629a010f7ef907d457343abcb569fab7 (patch) | |
tree | f426b5eb8312ac0458ecf0ae256f7d8b65f71af0 /gcc/cgraphclones.c | |
parent | effcb4181e143bc390286a489ff849768a49f6af (diff) | |
download | gcc-d7a65edb629a010f7ef907d457343abcb569fab7.zip gcc-d7a65edb629a010f7ef907d457343abcb569fab7.tar.gz gcc-d7a65edb629a010f7ef907d457343abcb569fab7.tar.bz2 |
List valid pairs for new and delete operators.
PR c++/94314
* cgraphclones.c (set_new_clone_decl_and_node_flags): Drop
DECL_IS_REPLACEABLE_OPERATOR during cloning.
* tree-ssa-dce.c (valid_new_delete_pair_p): New function.
(propagate_necessity): Check operator names.
PR c++/94314
* g++.dg/pr94314.C: Do not use dg-additional-options
and remove not needed stdio.h include.
* g++.dg/pr94314-2.C: Likewise.
* g++.dg/pr94314-3.C: Likewise.
* g++.dg/pr94314-4.C: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index c73b8f8..8f541a2 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -165,6 +165,7 @@ set_new_clone_decl_and_node_flags (cgraph_node *new_node) DECL_STATIC_DESTRUCTOR (new_node->decl) = 0; DECL_SET_IS_OPERATOR_NEW (new_node->decl, 0); DECL_SET_IS_OPERATOR_DELETE (new_node->decl, 0); + DECL_IS_REPLACEABLE_OPERATOR (new_node->decl) = 0; new_node->externally_visible = 0; new_node->local = 1; @@ -1030,6 +1031,7 @@ cgraph_node::create_version_clone_with_body DECL_STATIC_DESTRUCTOR (new_decl) = 0; DECL_SET_IS_OPERATOR_NEW (new_decl, 0); DECL_SET_IS_OPERATOR_DELETE (new_decl, 0); + DECL_IS_REPLACEABLE_OPERATOR (new_decl) = 0; /* Create the new version's call-graph node. and update the edges of the new node. */ |