diff options
author | Roger Sayle <roger@eyesopen.com> | 2004-03-08 21:56:36 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2004-03-08 21:56:36 +0000 |
commit | e697b20f797e8350fd462183d86ef91ce0ef2c64 (patch) | |
tree | 93edd15f6d8a3af3c971d1499927e5190c015173 /gcc/function.c | |
parent | 59f8a8be077b37d2933480dcada348104a00093f (diff) | |
download | gcc-e697b20f797e8350fd462183d86ef91ce0ef2c64.zip gcc-e697b20f797e8350fd462183d86ef91ce0ef2c64.tar.gz gcc-e697b20f797e8350fd462183d86ef91ce0ef2c64.tar.bz2 |
re PR middle-end/14289 (ICE in a register array)
PR middle-end/14289
* c-typeck.c (c_mark_addressable): A register variable should
be considered global if its not automatic, i.e. TREE_PUBLIC,
TREE_STATIC or DECL_EXTERNAL.
* function.c (put_var_into_stack): Call abort when placing a
hard register into the stack, if x_parm_reg_stack_loc is NULL.
* gcc.dg/pr14289-1.c: New test case.
* gcc.dg/pr14289-2.c: Likewise.
* gcc.dg/pr14289-3.c: Likewise.
From-SVN: r79127
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c index b59707a..4fffcd8 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1430,8 +1430,9 @@ put_var_into_stack (tree decl, int rescan) static void put_reg_into_stack (struct function *function, rtx reg, tree type, - enum machine_mode promoted_mode, enum machine_mode decl_mode, - int volatile_p, unsigned int original_regno, int used_p, htab_t ht) + enum machine_mode promoted_mode, + enum machine_mode decl_mode, int volatile_p, + unsigned int original_regno, int used_p, htab_t ht) { struct function *func = function ? function : cfun; rtx new = 0; @@ -1441,7 +1442,11 @@ put_reg_into_stack (struct function *function, rtx reg, tree type, regno = REGNO (reg); if (regno < func->x_max_parm_reg) - new = func->x_parm_reg_stack_loc[regno]; + { + if (!func->x_parm_reg_stack_loc) + abort (); + new = func->x_parm_reg_stack_loc[regno]; + } if (new == 0) new = assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func); |