aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2005-02-23 05:08:32 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2005-02-23 00:08:32 -0500
commit90c1d75a9bb8e25aa963da02f9c91f5f40143be1 (patch)
tree5ae2c9a5dd60102e5ee665ad3f8aaaba2450f32e /gcc/tree-ssa-operands.c
parent397763d2af80316f05484a8668c3d0dddf2c9811 (diff)
downloadgcc-90c1d75a9bb8e25aa963da02f9c91f5f40143be1.zip
gcc-90c1d75a9bb8e25aa963da02f9c91f5f40143be1.tar.gz
gcc-90c1d75a9bb8e25aa963da02f9c91f5f40143be1.tar.bz2
re PR tree-optimization/20100 (LIM is pulling out a pure function even though there is something which can modify global memory)
PR tree-optimization/20100 PR tree-optimization/20115 * tree-optimize.c (init_tree_optimization_passes): Remove pass_maybe_create_global_var. * tree-pass.h (pass_maybe_create_global_var): Remove. * tree-ssa-alias.c (aliases_computed_p): Declare. (struct alias_info): Add field NUM_PURE_CONST_CALLS_FOUND. (count_calls_and_maybe_create_global_var): Remove. (pass_maybe_create_global_var): Remove. (init_alias_info): Do not declare aliases_computed_p. (maybe_create_global_var): If the function contains no call-clobbered variables and a mix of pure/const and regular function calls, create .GLOBAL_VAR. Mark all call-clobbered variables for renaming. (merge_pointed_to_info): Update comment. (add_pointed_to_var): Likewise. (is_escape_site): Likewise. Accept struct alias_info * instead of size_t *. Update all users. Update AI->NUM_CALLS_FOUND and AI->NUM_PURE_CONST_CALLS_FOUND as necessary. * tree-ssa-operands.c (get_call_expr_operands): If ALIASES_COMPUTED_P is false, do not add call-clobbering operands. * tree-ssa.c (init_tree_ssa): Set ALIASES_COMPUTED_P to false. (delete_tree_ssa): Likewise. testsuite/ChangeLog PR tree-optimization/20100 PR tree-optimization/20115 * gcc.dg/pr20115.c: New test. * gcc.dg/pr20115-1.c: New test. * gcc.dg/pr20100.c: New test. * gcc.dg/tree-ssa/20040517-1.c: Expect virtual operands for call-clobbered variables after alias1. From-SVN: r95437
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 0f27912..3b5de9b 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1460,7 +1460,17 @@ get_call_expr_operands (tree stmt, tree expr)
tree op;
int call_flags = call_expr_flags (expr);
- if (!bitmap_empty_p (call_clobbered_vars))
+ /* If aliases have been computed already, add V_MAY_DEF or V_USE
+ operands for all the symbols that have been found to be
+ call-clobbered.
+
+ Note that if aliases have not been computed, the global effects
+ of calls will not be included in the SSA web. This is fine
+ because no optimizer should run before aliases have been
+ computed. By not bothering with virtual operands for CALL_EXPRs
+ we avoid adding superfluous virtual operands, which can be a
+ significant compile time sink (See PR 15855). */
+ if (aliases_computed_p && !bitmap_empty_p (call_clobbered_vars))
{
/* A 'pure' or a 'const' functions never call clobber anything.
A 'noreturn' function might, but since we don't return anyway