/* Save and restore call-clobbered registers which are live across a call.
- Copyright (C) 1989, 1992, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992, 1994, 1995, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include "config.h"
#include "rtl.h"
reg_save_code[i][j] = recog_memoized (saveinsn);
reg_restore_code[i][j] = recog_memoized (restinsn);
- /* Now extract both insns and see if we can meet their constraints. */
+ /* Now extract both insns and see if we can meet their
+ constraints. */
ok = (reg_save_code[i][j] != -1 && reg_restore_code[i][j] != -1);
if (ok)
{
ok &= (TEST_HARD_REG_BIT (hard_regs_used, regno) != 0);
}
- /* We have found an acceptable mode to store in. */
+ /* We have found an acceptable mode to store in. */
if (ok)
{
= assign_stack_local (regno_save_mode[i][j],
GET_MODE_SIZE (regno_save_mode[i][j]), 0);
- /* Setup single word save area just in case... */
+ /* Setup single word save area just in case... */
for (k = 0; k < j; k++)
{
/* This should not depend on WORDS_BIG_ENDIAN.
for (j = 1; j <= MOVE_MAX / UNITS_PER_WORD; j++)
if (regno_save_mem[i][j] != 0)
ok &= strict_memory_address_p (GET_MODE (regno_save_mem[i][j]),
- XEXP (eliminate_regs (regno_save_mem[i][j], 0, NULL_RTX), 0));
+ XEXP (eliminate_regs (regno_save_mem[i][j], 0, NULL_RTX, 1), 0));
return ok;
}
n_regs_saved++;
}
else
- note_stores (PATTERN (insn), set_reg_live);
+ {
+ note_stores (PATTERN (insn), set_reg_live);
+#ifdef AUTO_INC_DEC
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_INC)
+ set_reg_live (XEXP (link, 0), NULL_RTX);
+#endif
+ }
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) == REG_UNUSED)