summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-28 05:13:10 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-28 05:13:10 +0000
commitf45a1ca16b84548bea3b49f7090e5fc6affe776d (patch)
treea9aa14b2fab671abc299a440ee7b02eaae3b2aeb /gcc/tree-ssa-operands.c
parent4d0876abe8aa84ef5dd8a42c74c6a8bb76197afc (diff)
downloadgcc-f45a1ca16b84548bea3b49f7090e5fc6affe776d.tar.gz
* tree-optimize.c (init_tree_optimization_passes): Schedule
pass_may_alias right after the program is renamed into SSA. * tree-pass.h (PROP_alias): Define. * tree-outof-ssa.c (pass_del_ssa): Require PROP_alias. * tree-sra.c (pass_sra): Likewise. * tree-ssa-ccp.c (pass_ccp): Likewise. * tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise. * tree-ssa-dce.c (pass_dce): Likewise. * tree-ssa-dom.c (pass_dominator): Likewise. * tree-ssa-dse.c (pass_dse): Likewise. * tree-ssa-forwprop.c (pass_forwprop): Likewise. * tree-ssa-loop-ch.c (pass_ch): Likewise. * tree-ssa-phiopt.c (pass_phiopt): Likewise. * tree-ssa-pre.c (pass_pre): Likewise. * tree-tailcall.c (pass_tail_recursion): Likewise. * tree-ssa.c (pass_redundant_phi): Likewise. * tree-ssa-alias.c (aliases_computed_p): Remove. Update all users. (init_alias_info): Do not mark all type tags for renaming unconditionally. Clear may_aliases from every symbol. (setup_pointers_and_addressables): If a pointer has not been dereferenced and it had a type tag, clear it and mark the old tag for renaming. testsuite/ChangeLog * gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected conditionals. * gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected loads. * gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in DOM1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c85
1 files changed, 29 insertions, 56 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index bd80da33341..a9e864ed8c1 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1137,13 +1137,6 @@ get_asm_expr_operands (tree stmt, voperands_t prev_vops)
add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
});
- /* If we don't have call-clobbered nor addressable vars and we
- still have not computed aliasing information, just mark the
- statement as having volatile operands. If the alias pass
- finds some, we will add them at that point. */
- if (!aliases_computed_p)
- stmt_ann (stmt)->has_volatile_ops = true;
-
break;
}
}
@@ -1159,53 +1152,42 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
if (SSA_VAR_P (ptr))
{
- if (!aliases_computed_p)
+ struct ptr_info_def *pi = NULL;
+
+ /* If PTR has flow-sensitive points-to information, use it. */
+ if (TREE_CODE (ptr) == SSA_NAME
+ && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
+ && pi->name_mem_tag)
{
- /* If the pointer does not have a memory tag and aliases have not
- been computed yet, mark the statement as having volatile
- operands to prevent DOM from entering it in equivalence tables
- and DCE from killing it. */
- stmt_ann (stmt)->has_volatile_ops = true;
+ /* PTR has its own memory tag. Use it. */
+ add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
}
else
{
- struct ptr_info_def *pi = NULL;
-
- /* If we have computed aliasing already, check if PTR has
- flow-sensitive points-to information. */
- if (TREE_CODE (ptr) == SSA_NAME
- && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
- && pi->name_mem_tag)
+ /* If PTR is not an SSA_NAME or it doesn't have a name
+ tag, use its type memory tag. */
+ var_ann_t ann;
+
+ /* If we are emitting debugging dumps, display a warning if
+ PTR is an SSA_NAME with no flow-sensitive alias
+ information. That means that we may need to compute
+ aliasing again. */
+ if (dump_file
+ && TREE_CODE (ptr) == SSA_NAME
+ && pi == NULL)
{
- /* PTR has its own memory tag. Use it. */
- add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
+ fprintf (dump_file,
+ "NOTE: no flow-sensitive alias info for ");
+ print_generic_expr (dump_file, ptr, dump_flags);
+ fprintf (dump_file, " in ");
+ print_generic_stmt (dump_file, stmt, dump_flags);
}
- else
- {
- /* If PTR is not an SSA_NAME or it doesn't have a name
- tag, use its type memory tag. */
- var_ann_t ann;
-
- /* If we are emitting debugging dumps, display a warning if
- PTR is an SSA_NAME with no flow-sensitive alias
- information. That means that we may need to compute
- aliasing again. */
- if (dump_file
- && TREE_CODE (ptr) == SSA_NAME
- && pi == NULL)
- {
- fprintf (dump_file,
- "NOTE: no flow-sensitive alias info for ");
- print_generic_expr (dump_file, ptr, dump_flags);
- fprintf (dump_file, " in ");
- print_generic_stmt (dump_file, stmt, dump_flags);
- }
- if (TREE_CODE (ptr) == SSA_NAME)
- ptr = SSA_NAME_VAR (ptr);
- ann = var_ann (ptr);
- add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
- }
+ if (TREE_CODE (ptr) == SSA_NAME)
+ ptr = SSA_NAME_VAR (ptr);
+ ann = var_ann (ptr);
+ if (ann->type_mem_tag)
+ add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
}
}
@@ -1272,8 +1254,6 @@ get_call_expr_operands (tree stmt, tree expr, voperands_t prev_vops)
else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
add_call_read_ops (stmt, prev_vops);
}
- else if (!aliases_computed_p)
- stmt_ann (stmt)->has_volatile_ops = true;
}
@@ -1348,13 +1328,6 @@ add_stmt_operand (tree *var_p, tree stmt, int flags, voperands_t prev_vops)
aliases = v_ann->may_aliases;
- /* If alias information hasn't been computed yet, then
- addressable variables will not be an alias tag nor will they
- have aliases. In this case, mark the statement as having
- volatile operands. */
- if (!aliases_computed_p && may_be_aliased (var))
- s_ann->has_volatile_ops = true;
-
if (aliases == NULL)
{
/* The variable is not aliased or it is an alias tag. */