aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-icf-gimple.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-10-01 10:44:27 +0200
committerRichard Biener <rguenther@suse.de>2020-10-02 11:22:20 +0200
commit0b945f959f03a6185a3130f30bfd524d01d4142c (patch)
treec61ced9467e75d017f2ef2df083b466f5b345aeb /gcc/ipa-icf-gimple.c
parentb6158faacbfb7d24a1d25b3774bc4338dd849480 (diff)
downloadgcc-0b945f959f03a6185a3130f30bfd524d01d4142c.zip
gcc-0b945f959f03a6185a3130f30bfd524d01d4142c.tar.gz
gcc-0b945f959f03a6185a3130f30bfd524d01d4142c.tar.bz2
make use of CALL_FROM_NEW_OR_DELETE_P
This fixes points-to analysis and DCE to only consider new/delete operator calls from new or delete expressions and not direct calls. 2020-10-01 Richard Biener <rguenther@suse.de> * gimple.h (GF_CALL_FROM_NEW_OR_DELETE): New call flag. (gimple_call_set_from_new_or_delete): New. (gimple_call_from_new_or_delete): Likewise. * gimple.c (gimple_build_call_from_tree): Set GF_CALL_FROM_NEW_OR_DELETE appropriately. * ipa-icf-gimple.c (func_checker::compare_gimple_call): Compare gimple_call_from_new_or_delete. * tree-ssa-dce.c (mark_all_reaching_defs_necessary_1): Make sure to only consider new/delete calls from new or delete expressions. (propagate_necessity): Likewise. (eliminate_unnecessary_stmts): Likewise. * tree-ssa-structalias.c (find_func_aliases_for_call): Likewise. * g++.dg/tree-ssa/pta-delete-1.C: New testcase.
Diffstat (limited to 'gcc/ipa-icf-gimple.c')
-rw-r--r--gcc/ipa-icf-gimple.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index 1cd5872..d5423a7 100644
--- a/gcc/ipa-icf-gimple.c
+++ b/gcc/ipa-icf-gimple.c
@@ -556,6 +556,7 @@ func_checker::compare_gimple_call (gcall *s1, gcall *s2)
|| gimple_call_tail_p (s1) != gimple_call_tail_p (s2)
|| gimple_call_return_slot_opt_p (s1) != gimple_call_return_slot_opt_p (s2)
|| gimple_call_from_thunk_p (s1) != gimple_call_from_thunk_p (s2)
+ || gimple_call_from_new_or_delete (s1) != gimple_call_from_new_or_delete (s2)
|| gimple_call_va_arg_pack_p (s1) != gimple_call_va_arg_pack_p (s2)
|| gimple_call_alloca_for_var_p (s1) != gimple_call_alloca_for_var_p (s2))
return false;