diff options
author | Richard Guenther <rguenther@suse.de> | 2011-09-06 15:56:20 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-09-06 15:56:20 +0000 |
commit | df2f61000e93a5c300703c9f23af007c0621693f (patch) | |
tree | fbde3337b79e868502c2f6f97441b602320dba10 /gcc/tree-ssa-structalias.c | |
parent | e972fd5281b7268411de938719ce150944100105 (diff) | |
download | gcc-df2f61000e93a5c300703c9f23af007c0621693f.zip gcc-df2f61000e93a5c300703c9f23af007c0621693f.tar.gz gcc-df2f61000e93a5c300703c9f23af007c0621693f.tar.bz2 |
re PR target/47025 (Dead stores in variadic functions not eliminated)
2011-09-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47025
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): BUILT_IN_VA_END
uses nothing.
(call_may_clobber_ref_p_1): BUILT_IN_VA_END is a barrier like
BUILT_IN_FREE.
(stmt_kills_ref_p_1): BUILT_IN_VA_END kills what its argument
definitely points to.
* tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
BUILT_IN_VA_START doesn't let its va_list argument escape.
* tree-ssa-dce.c (propagate_necessity): BUILT_IN_VA_END does
not make any previous stores necessary.
From-SVN: r178601
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index d69f14c..edfbd64 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4187,27 +4187,32 @@ find_func_aliases_for_builtin_call (gimple t) mode as well. */ case BUILT_IN_VA_START: { + tree valist = gimple_call_arg (t, 0); + struct constraint_expr rhs, *lhsp; + unsigned i; + get_constraint_for (valist, &lhsc); + do_deref (&lhsc); + /* The va_list gets access to pointers in variadic + arguments. Which we know in the case of IPA analysis + and otherwise are just all nonlocal variables. */ if (in_ipa_mode) { - tree valist = gimple_call_arg (t, 0); - struct constraint_expr rhs, *lhsp; - unsigned i; - /* The va_list gets access to pointers in variadic - arguments. */ fi = lookup_vi_for_tree (cfun->decl); - gcc_assert (fi != NULL); - get_constraint_for (valist, &lhsc); - do_deref (&lhsc); rhs = get_function_part_constraint (fi, ~0); rhs.type = ADDRESSOF; - FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp) - process_constraint (new_constraint (*lhsp, rhs)); - VEC_free (ce_s, heap, lhsc); - /* va_list is clobbered. */ - make_constraint_to (get_call_clobber_vi (t)->id, valist); - return true; } - break; + else + { + rhs.var = nonlocal_id; + rhs.type = ADDRESSOF; + rhs.offset = 0; + } + FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp) + process_constraint (new_constraint (*lhsp, rhs)); + VEC_free (ce_s, heap, lhsc); + /* va_list is clobbered. */ + make_constraint_to (get_call_clobber_vi (t)->id, valist); + return true; } /* va_end doesn't have any effect that matters. */ case BUILT_IN_VA_END: |