From 8cb65b3725f0c31a3ea5d5b8de37eacba55462f3 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 21 Aug 2014 11:32:21 +0200 Subject: re PR tree-optimization/62112 (Optimize out malloc when block is unused or write-only) 2014-08-21 Marc Glisse PR tree-optimization/62112 gcc/ * gimple-iterator.c (gsi_replace): Return whether EH cleanup is needed. * gimple-iterator.h (gsi_replace): Return bool. * tree-ssa-alias.c (ref_may_alias_global_p_1): New helper, code moved from ref_may_alias_global_p. (ref_may_alias_global_p, refs_may_alias_p, ref_maybe_used_by_stmt_p): New overloads. (ref_maybe_used_by_call_p): Take ao_ref* instead of tree. (stmt_kills_ref_p_1): Rename... (stmt_kills_ref_p): ... to this. * tree-ssa-alias.h (ref_may_alias_global_p, ref_maybe_used_by_stmt_p, stmt_kills_ref_p): Declare. * tree-ssa-dse.c (dse_possible_dead_store_p): New argument, use it. Move the self-assignment case... (dse_optimize_stmt): ... here. Handle builtin calls. Remove dead code. gcc/testsuite/ * gcc.dg/tree-ssa/pr62112-1.c: New file. * gcc.dg/tree-ssa/pr62112-2.c: Likewise. * gcc.c-torture/execute/pr35472.c: Add noclone attribute. * gcc.c-torture/execute/20071219-1.c: Likewise. From-SVN: r214262 --- gcc/tree-ssa-alias.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/tree-ssa-alias.h') diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h index e46f89e..436381a 100644 --- a/gcc/tree-ssa-alias.h +++ b/gcc/tree-ssa-alias.h @@ -101,17 +101,20 @@ extern alias_set_type ao_ref_alias_set (ao_ref *); extern bool ptr_deref_may_alias_global_p (tree); extern bool ptr_derefs_may_alias_p (tree, tree); extern bool ref_may_alias_global_p (tree); +extern bool ref_may_alias_global_p (ao_ref *); extern bool refs_may_alias_p (tree, tree); extern bool refs_may_alias_p_1 (ao_ref *, ao_ref *, bool); extern bool refs_anti_dependent_p (tree, tree); extern bool refs_output_dependent_p (tree, tree); extern bool ref_maybe_used_by_stmt_p (gimple, tree); +extern bool ref_maybe_used_by_stmt_p (gimple, ao_ref *); extern bool stmt_may_clobber_global_p (gimple); extern bool stmt_may_clobber_ref_p (gimple, tree); extern bool stmt_may_clobber_ref_p_1 (gimple, ao_ref *); extern bool call_may_clobber_ref_p (gimple, tree); extern bool call_may_clobber_ref_p_1 (gimple, ao_ref *); extern bool stmt_kills_ref_p (gimple, tree); +extern bool stmt_kills_ref_p (gimple, ao_ref *); extern tree get_continuation_for_phi (gimple, ao_ref *, unsigned int *, bitmap *, bool, void *(*)(ao_ref *, tree, void *, bool), -- cgit v1.1