From 7e14028056eafe6486281fb96d17d2f873f6248f Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 20 May 2004 10:37:02 -0700 Subject: re PR tree-optimization/15454 (tree-ccp generates wrong code for nested functions) PR 15454 * tree-nested.c (get_chain_decl): Create a PARM_DECL by hand. * function.c (expand_function_start): Expand static_chain_decl by hand. * gimplify.c (create_tmp_var_name): Export. * tree-gimple.h (create_tmp_var_name): Declare. * gcc.c-torture/execute/20040520-1.c: New. From-SVN: r82064 --- gcc/tree-nested.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gcc/tree-nested.c') diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 1a00ff30f86..14d2c3cb9ff 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -306,15 +306,16 @@ get_chain_decl (struct nesting_info *info) /* Note that this variable is *not* entered into any BIND_EXPR; the construction of this variable is handled specially in - expand_function_start and initialize_inlined_parameters. */ - decl = create_tmp_var_raw (type, "CHAIN"); + expand_function_start and initialize_inlined_parameters. + Note also that it's represented as a parameter. This is more + close to the truth, since the initial value does come from + the caller. */ + decl = build_decl (PARM_DECL, create_tmp_var_name ("CHAIN"), type); + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + TREE_USED (decl) = 1; DECL_CONTEXT (decl) = info->context; - decl->decl.seen_in_bind_expr = 1; - - /* The initialization of CHAIN is not visible to the tree-ssa - analyzers and optimizers. Thus we do not want to issue - warnings for CHAIN. */ - TREE_NO_WARNING (decl) = 1; + DECL_ARG_TYPE (decl) = type; /* Tell tree-inline.c that we never write to this variable, so it can copy-prop the replacement value immediately. */ -- cgit v1.2.1