List valid pairs for new and delete operators.
authorMartin Liska <mliska@suse.cz>
Thu, 16 Apr 2020 13:39:22 +0000 (15:39 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 16 Apr 2020 13:39:22 +0000 (15:39 +0200)
commitd7a65edb629a010f7ef907d457343abcb569fab7
treef426b5eb8312ac0458ecf0ae256f7d8b65f71af0
parenteffcb4181e143bc390286a489ff849768a49f6af
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>
gcc/ChangeLog
gcc/cgraphclones.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr94314-2.C
gcc/testsuite/g++.dg/pr94314-3.C
gcc/testsuite/g++.dg/pr94314-4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr94314.C
gcc/tree-ssa-dce.c