Postpone expanding va_arg until pass_stdarg

Programming / Compilers / GCC - vries [138bc75d-0d04-0410-961f-82ee72b054a4] - 17 April 2015 04:26 UTC

2015-04-17 Tom de Vries Michael Matz

- gimple-iterator.c (update_modified_stmts): Remove static.
- gimple-iterator.h (update_modified_stmts): Declare.
- gimplify.c (gimplify_modify_expr): Handle IFN_VA_ARG. (gimplify_va_arg_internal): New function. (gimplify_va_arg_expr): Use IFN_VA_ARG.
- gimplify.h (gimplify_va_arg_internal): Declare.
- internal-fn.c (expand_VA_ARG): New unreachable function.
- internal-fn.def (VA_ARG): New DEF_INTERNAL_FN.
- tree-stdarg.c (gimple_call_ifn_va_arg_p, expand_ifn_va_arg_1) (expand_ifn_va_arg): New function. (pass_data_stdarg): Add PROP_gimple_lva to properties_provided field. (pass_stdarg::execute): Call expand_ifn_va_arg. (pass_data_lower_vaarg): New pass_data. (pass_lower_vaarg): New gimple_opt_pass. (pass_lower_vaarg::gate, pass_lower_vaarg::execute) (make_pass_lower_vaarg): New function.
- cfgexpand.c (pass_data_expand): Add PROP_gimple_lva to properties_required field.
- passes.def (all_passes): Add pass_lower_vaarg.
- tree-pass.h (PROP_gimple_lva): Add define. (make_pass_lower_vaarg): Declare.

- gcc.dg/tree-ssa/stdarg-2.c: Change f15 scan-tree-dump for target x86_64-*-*.

82fc0e0 Postpone expanding va_arg until pass_stdarg
gcc/ChangeLog | 25 ++++
gcc/cfgexpand.c | 3 +-
gcc/gimple-iterator.c | 2 +-
gcc/gimple-iterator.h | 1 +
gcc/gimplify.c | 111 +++++++++++++-----
gcc/gimplify.h | 2 +
gcc/internal-fn.c | 9 ++
gcc/internal-fn.def | 1 +
gcc/passes.def | 1 +
gcc/testsuite/ChangeLog | 6 +
gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c | 4 +-
gcc/tree-pass.h | 2 +
gcc/tree-stdarg.c | 184 +++++++++++++++++++++++++++---
13 files changed, 304 insertions(+), 47 deletions(-)

Upstream: gcc.gnu.org


  • Share