diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-17 09:27:08 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-17 09:27:08 +0000 |
commit | 8e21ebb17798a4a668bcf425470a28535c1d93fd (patch) | |
tree | da8ccc329015608df03029dffb874f96544fad71 | |
parent | 82fc0e0a3a4f82770e7e076cab5309bb1bd9fe87 (diff) | |
download | gcc-8e21ebb17798a4a668bcf425470a28535c1d93fd.tar.gz |
Set PROP_gimple_lva for functions without IFN_VA_ARG
2015-04-17 Tom de Vries <tom@codesourcery.com>
* gimplify.c (gimplify_function_tree): Tentatively set PROP_gimple_lva
in cfun->curr_properties.
(gimplify_va_arg_expr): Clear PROP_gimple_lva in cfun->curr_properties
if we generate an IFN_VA_ARG.
* tree-inline.c (expand_call_inline): Reset PROP_gimple_lva in dest
function if PROP_gimple_lva is not set in src function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222174 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/gimplify.c | 10 | ||||
-rw-r--r-- | gcc/tree-inline.c | 8 |
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fb57eae57c..c0e804380e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,13 @@ 2015-04-17 Tom de Vries <tom@codesourcery.com> + + * gimplify.c (gimplify_function_tree): Tentatively set PROP_gimple_lva + in cfun->curr_properties. + (gimplify_va_arg_expr): Clear PROP_gimple_lva in cfun->curr_properties + if we generate an IFN_VA_ARG. + * tree-inline.c (expand_call_inline): Reset PROP_gimple_lva in dest + function if PROP_gimple_lva is not set in src function. + +2015-04-17 Tom de Vries <tom@codesourcery.com> Michael Matz <matz@suse.de> * gimple-iterator.c (update_modified_stmts): Remove static. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index e1ea2049164..0394543ef7b 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -9201,6 +9201,10 @@ gimplify_function_tree (tree fndecl) else push_struct_function (fndecl); + /* Tentatively set PROP_gimple_lva here, and reset it in gimplify_va_arg_expr + if necessary. */ + cfun->curr_properties |= PROP_gimple_lva; + for (parm = DECL_ARGUMENTS (fndecl); parm ; parm = DECL_CHAIN (parm)) { /* Preliminarily mark non-addressed complex variables as eligible @@ -9295,7 +9299,7 @@ gimplify_function_tree (tree fndecl) } DECL_SAVED_TREE (fndecl) = NULL_TREE; - cfun->curr_properties = PROP_gimple_any; + cfun->curr_properties |= PROP_gimple_any; pop_cfun (); } @@ -9414,6 +9418,10 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, tag = build_int_cst (build_pointer_type (type), 0); *expr_p = build_call_expr_internal_loc (loc, IFN_VA_ARG, type, 2, ap, tag); + /* Clear the tentatively set PROP_gimple_lva, to indicate that IFN_VA_ARG + needs to be expanded. */ + cfun->curr_properties &= ~PROP_gimple_lva; + return GS_OK; } diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 83e43356f60..42ddb9f47ed 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4526,6 +4526,14 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) id->src_cfun = DECL_STRUCT_FUNCTION (fn); id->call_stmt = stmt; + /* If the the src function contains an IFN_VA_ARG, then so will the dst + function after inlining. */ + if ((id->src_cfun->curr_properties & PROP_gimple_lva) == 0) + { + struct function *dst_cfun = DECL_STRUCT_FUNCTION (id->dst_fn); + dst_cfun->curr_properties &= ~PROP_gimple_lva; + } + gcc_assert (!id->src_cfun->after_inlining); id->entry_bb = bb; |