summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c72
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