diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2003-10-11 22:56:24 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-10-11 20:56:24 +0000 |
commit | 69efc31da2d437bce7aca9f6bf003a901619359c (patch) | |
tree | e6af32a291d4c1ae4f29ab69be8c1ad4e46b2738 /gcc/function.c | |
parent | 9d82a4b34c9d1349c45501ef64277ed746eb5012 (diff) | |
download | gcc-69efc31da2d437bce7aca9f6bf003a901619359c.zip gcc-69efc31da2d437bce7aca9f6bf003a901619359c.tar.gz gcc-69efc31da2d437bce7aca9f6bf003a901619359c.tar.bz2 |
re PR rtl-optimization/12544 (ICE with large parameters used in nested functions)
PR optimization/12544
* function.c (put_var_into_stack): Don't generate ADDRESSOFs
for DECL_NONLOCAL decls.
From-SVN: r72374
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index 427469e..6531c02 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1324,8 +1324,9 @@ put_var_into_stack (tree decl, int rescan) if (function->decl == context) break; - /* If this is a variable-size object with a pseudo to address it, - put that pseudo into the stack, if the var is nonlocal. */ + /* If this is a variable-sized object or a structure passed by invisible + reference, with a pseudo to address it, put that pseudo into the stack + if the var is non-local. */ if (TREE_CODE (decl) != SAVE_EXPR && DECL_NONLOCAL (decl) && GET_CODE (reg) == MEM && GET_CODE (XEXP (reg, 0)) == REG @@ -1335,8 +1336,12 @@ put_var_into_stack (tree decl, int rescan) decl_mode = promoted_mode = GET_MODE (reg); } + /* If this variable lives in the current function and we don't need to put it + in the stack for the sake of setjmp or the non-locality, try to keep it in + a register until we know we actually need the address. */ can_use_addressof = (function == 0 + && ! (TREE_CODE (decl) != SAVE_EXPR && DECL_NONLOCAL (decl)) && optimize > 0 /* FIXME make it work for promoted modes too */ && decl_mode == promoted_mode @@ -1355,9 +1360,6 @@ put_var_into_stack (tree decl, int rescan) if (GET_CODE (reg) == REG) { - /* If this variable lives in the current function and we don't need - to put things in the stack for the sake of setjmp, try to keep it - in a register until we know we actually need the address. */ if (can_use_addressof) gen_mem_addressof (reg, decl, rescan); else |