diff options
author | Jan Hubicka <jh@suse.cz> | 2007-01-11 17:50:32 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-01-11 16:50:32 +0000 |
commit | 7faade0f77b5bdc1c20c95d291c207aa2551e1bd (patch) | |
tree | b4875a136a081b16613b2c91b41d60c5a6882b7c /gcc/tree-ssa-operands.c | |
parent | 18d5e416f8b6ca75796803e6957aaa513fcf51dc (diff) | |
download | gcc-7faade0f77b5bdc1c20c95d291c207aa2551e1bd.tar.gz |
re PR tree-optimization/1046 (gcc less efficient than jdk for recursion with -finline-functions)
PR tree-optimization/1046
* tree-tailcall.c (suitable_for_tail_call_opt_p): Use TREE_ADDRESSABLE
when alias info is not ready.
(pass_tail_recursion): Do not require aliasing.
* tree-ssa-copyrename.c (pass_rename_ssa_cop): Likewise.
* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Likewise.
* tree-ssa-copy.c (pass_copy_prop): Likewise.
* tree-ssa-forwprop.c (pass_forwprop): Likewise.
* tree-ssa-dce.c (pass_dce, pass_dce_loop, pass_cd_dce): Likewise.
* passes.c (init_optimization_passes): Execute rename_ssa_copies,
ccp, forwprop, copy_prop, merge_phi, copy_prop, dce and tail recursion
before inlining.
* tree-ssa-operands.c (add_virtual_operand, get_indirect_ref_operand):
When aliasing is not build, mark statement as volatile.
* gcc.dg/tree-ssa/tailrecursion-4.c: Update dump file.
* gcc.dg/tree-ssa/tailrecursion-1.c: Update dump file.
* gcc.dg/tree-ssa/tailrecursion-2.c: Update dump file.
* gcc.dg/tree-ssa/tailrecursion-3.c: Update dump file.
* gcc.dg/tree-ssa/pr21658.c: Likewise.
* gcc.dg/tree-ssa/pr15349.c: Likewise.
* gcc.dg/tree-ssa/pr25501.c: Likewise.
* gcc.dg/tree-ssa/vrp11.c: Make more complex so it still test
transformation in question.
* gcc.dg/tree-ssa/vrp05.c: Likewise.
* gcc.dg/tree-ssa/pr20701.c: Likewise.
* gcc.dg/always_inline3.c: Likewise.
From-SVN: r120681
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 9d4b84cc709..23e493a2b04 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1480,6 +1480,8 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, aliases = v_ann->may_aliases; if (aliases == NULL) { + if (s_ann && !gimple_aliases_computed_p (cfun)) + s_ann->has_volatile_ops = true; /* The variable is not aliased or it is an alias tag. */ if (flags & opf_def) append_vdef (var); @@ -1610,6 +1612,8 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, stmt_ann_t s_ann = stmt_ann (stmt); s_ann->references_memory = true; + if (s_ann && TREE_THIS_VOLATILE (expr)) + s_ann->has_volatile_ops = true; if (SSA_VAR_P (ptr)) { @@ -1652,6 +1656,11 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, if (v_ann->symbol_mem_tag) add_virtual_operand (v_ann->symbol_mem_tag, s_ann, flags, full_ref, offset, size, false); + /* Aliasing information is missing; mark statement as volatile so we + won't optimize it out too actively. */ + else if (s_ann && !gimple_aliases_computed_p (cfun) + && (flags & opf_def)) + s_ann->has_volatile_ops = true; } } else if (TREE_CODE (ptr) == INTEGER_CST) |