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/function.c | |
parent | 5ce7d75d89b0da57124c2461364c32f1e7f7910b (diff) | |
download | gcc-7e14028056eafe6486281fb96d17d2f873f6248f.zip gcc-7e14028056eafe6486281fb96d17d2f873f6248f.tar.gz gcc-7e14028056eafe6486281fb96d17d2f873f6248f.tar.bz2 |
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/function.c')
-rw-r--r-- | gcc/function.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index 4c535c7..c34c191 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6565,12 +6565,15 @@ expand_function_start (tree subr, int parms_have_cleanups) /* If function gets a static chain arg, store it. */ if (cfun->static_chain_decl) { - rtx x; + tree parm = cfun->static_chain_decl; + rtx local = gen_reg_rtx (Pmode); + + set_decl_incoming_rtl (parm, static_chain_incoming_rtx); + SET_DECL_RTL (parm, local); + maybe_set_unchanging (local, parm); + mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm)))); - expand_var (cfun->static_chain_decl); - x = expand_expr (cfun->static_chain_decl, NULL_RTX, - VOIDmode, EXPAND_WRITE); - emit_move_insn (x, static_chain_incoming_rtx); + emit_move_insn (local, static_chain_incoming_rtx); } /* If the function receives a non-local goto, then store the |