Postpone expanding va_arg until pass_stdarg
authorTom de Vries <tom@codesourcery.com>
Fri, 17 Apr 2015 09:26:59 +0000 (09:26 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 17 Apr 2015 09:26:59 +0000 (09:26 +0000)
commitf8e89441bc5518f450b6511c59c17c837859d109
tree5d4de8b2de7d1bc521bef75e9c0cea144cf87699
parent1691b2e1ca494eee178a70c73c0f941ff27118f6
Postpone expanding va_arg until pass_stdarg

2015-04-17  Tom de Vries  <tom@codesourcery.com>
    Michael Matz  <matz@suse.de>

* 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-*-*.

Co-Authored-By: Michael Matz <matz@suse.de>
From-SVN: r222173
13 files changed:
gcc/ChangeLog
gcc/cfgexpand.c
gcc/gimple-iterator.c
gcc/gimple-iterator.h
gcc/gimplify.c
gcc/gimplify.h
gcc/internal-fn.c
gcc/internal-fn.def
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c
gcc/tree-pass.h
gcc/tree-stdarg.c