diff options
author | Richard Henderson <rth@redhat.com> | 2004-05-20 10:37:02 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-05-20 10:37:02 -0700 |
commit | 7e14028056eafe6486281fb96d17d2f873f6248f (patch) | |
tree | 26093e305b2beac279f6e5071f666f80884039c2 /gcc/tree-nested.c | |
parent | 5ce7d75d89b0da57124c2461364c32f1e7f7910b (diff) | |
download | gcc-7e14028056eafe6486281fb96d17d2f873f6248f.tar.gz |
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
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r-- | gcc/tree-nested.c | 17 |
1 files changed, 9 insertions, 8 deletions
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. */ |