diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-27 11:58:20 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-27 11:58:20 +0000 |
commit | 8763c2234ac99001c0adfc83f26565ec912f06c0 (patch) | |
tree | 414ccb0957bfcd13bd3b6838959bdaa52d3ef9c4 /gcc/tree-ssa-sink.c | |
parent | 845b40c89fc7ba4a93a2bccd7d8ce85b614a2241 (diff) | |
download | gcc-8763c2234ac99001c0adfc83f26565ec912f06c0.tar.gz |
2012-04-27 Richard Guenther <rguenther@suse.de>
* tree-flow.h (is_hidden_global_store): Remove.
* tree-ssa-sink.c (is_hidden_global_store): Likewise.
* tree-ssa-alias.h (ref_may_alias_global_p): Declare.
(stmt_may_clobber_global_p): Likewise.
* tree-ssa-alias.c (ref_may_alias_global_p): New function.
(stmt_may_clobber_global_p): Likewise.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Call
stmt_may_clobber_global_p.
* tree-ssa-dse.c (dse_possible_dead_store_p): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r-- | gcc/tree-ssa-sink.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index d42b46a1801..951e427f0b1 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -132,78 +132,6 @@ all_immediate_uses_same_place (gimple stmt) return true; } -/* Some global stores don't necessarily have VDEF's of global variables, - but we still must avoid moving them around. */ - -bool -is_hidden_global_store (gimple stmt) -{ - /* Check virtual definitions. If we get here, the only virtual - definitions we should see are those generated by assignment or call - statements. */ - if (gimple_vdef (stmt)) - { - tree lhs; - - gcc_assert (is_gimple_assign (stmt) || is_gimple_call (stmt)); - - /* Note that we must not check the individual virtual operands - here. In particular, if this is an aliased store, we could - end up with something like the following (SSA notation - redacted for brevity): - - foo (int *p, int i) - { - int x; - p_1 = (i_2 > 3) ? &x : p; - - # x_4 = VDEF <x_3> - *p_1 = 5; - - return 2; - } - - Notice that the store to '*p_1' should be preserved, if we - were to check the virtual definitions in that store, we would - not mark it needed. This is because 'x' is not a global - variable. - - Therefore, we check the base address of the LHS. If the - address is a pointer, we check if its name tag or symbol tag is - a global variable. Otherwise, we check if the base variable - is a global. */ - lhs = gimple_get_lhs (stmt); - - if (REFERENCE_CLASS_P (lhs)) - lhs = get_base_address (lhs); - - if (lhs == NULL_TREE) - { - /* If LHS is NULL, it means that we couldn't get the base - address of the reference. In which case, we should not - move this store. */ - return true; - } - else if (DECL_P (lhs)) - { - /* If the store is to a global symbol, we need to keep it. */ - if (is_global_var (lhs)) - return true; - - } - else if (INDIRECT_REF_P (lhs) - || TREE_CODE (lhs) == MEM_REF - || TREE_CODE (lhs) == TARGET_MEM_REF) - return ptr_deref_may_alias_global_p (TREE_OPERAND (lhs, 0)); - else if (CONSTANT_CLASS_P (lhs)) - return true; - else - gcc_unreachable (); - } - - return false; -} - /* Find the nearest common dominator of all of the immediate uses in IMM. */ static basic_block |