diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1992-06-26 07:06:07 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1992-06-26 07:06:07 -0400 |
commit | 42495ca044a8ecaf057eb4a6c82a47a562576ab8 (patch) | |
tree | 6b86d635f55150afa30d63508d7b707767beab90 /gcc/stmt.c | |
parent | 3a6e78aded8d4afe5150ce86c036efd096f79db0 (diff) | |
download | gcc-42495ca044a8ecaf057eb4a6c82a47a562576ab8.zip gcc-42495ca044a8ecaf057eb4a6c82a47a562576ab8.tar.gz gcc-42495ca044a8ecaf057eb4a6c82a47a562576ab8.tar.bz2 |
*** empty log message ***
From-SVN: r1296
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 39 |
1 files changed, 29 insertions, 10 deletions
@@ -2546,16 +2546,35 @@ expand_end_bindings (vars, mark_ends, dont_jump_in) #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM if (fixed_regs[ARG_POINTER_REGNUM]) { - /* Now restore our arg pointer from the address at which it was saved - in our stack frame. - If there hasn't be space allocated for it yet, make some now. */ - if (arg_pointer_save_area == 0) - arg_pointer_save_area - = assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0); - emit_move_insn (virtual_incoming_args_rtx, - /* We need a pseudo here, - or else instantiate_virtual_regs_1 complains. */ - copy_to_reg (arg_pointer_save_area)); +#ifdef ELIMINABLE_REGS + /* If the argument pointer can be eliminated in favor of the + frame pointer, we don't need to restore it. We assume here + that if such an elimination is present, it can always be used. + This is the case on all known machines; if we don't make this + assumption, we do unnecessary saving on many machines. */ + static struct elims {int from, to;} elim_regs[] = ELIMINABLE_REGS; + int i; + + for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++) + if (elim_regs[i].from == ARG_POINTER_REGNUM + && elim_regs[i].to == FRAME_POINTER_REGNUM) + break; + + if (i == sizeof elim_regs / sizeof elim_regs [0]) +#endif + { + /* Now restore our arg pointer from the address at which it + was saved in our stack frame. + If there hasn't be space allocated for it yet, make + some now. */ + if (arg_pointer_save_area == 0) + arg_pointer_save_area + = assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0); + emit_move_insn (virtual_incoming_args_rtx, + /* We need a pseudo here, or else + instantiate_virtual_regs_1 complains. */ + copy_to_reg (arg_pointer_save_area)); + } } #endif |