From 0af79961440b30cb08a61baef06b10f2e548e658 Mon Sep 17 00:00:00 2001 From: law Date: Mon, 19 Oct 1998 23:17:48 +0000 Subject: [PATCH] * gcse.c (compute_hash_table): Correctly identify hard regs which are clobbered across calls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23191 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/gcse.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85b586ddda2..254788dce15 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -19,6 +19,9 @@ Mon Oct 19 13:26:24 1998 Bernd Schmidt Mon Oct 19 11:40:56 1998 Jeffrey A Law (law@cygnus.com) + * gcse.c (compute_hash_table): Correctly identify hard regs which are + clobbered across calls. + * loop.c (scan_loop): Be more selective about what invariants are moved out of a loop. diff --git a/gcc/gcse.c b/gcc/gcse.c index 0fdf7655821..a330fef5b70 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2075,7 +2075,20 @@ compute_hash_table (f, set_p) if (GET_CODE (insn) == CALL_INSN) { for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (call_used_regs[regno]) + if ((call_used_regs[regno] + && regno != STACK_POINTER_REGNUM +#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM + && regno != HARD_FRAME_POINTER_REGNUM +#endif +#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM + && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) +#endif +#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) + && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic) +#endif + + && regno != FRAME_POINTER_REGNUM) + || global_regs[regno]) record_last_reg_set_info (insn, regno); if (! CONST_CALL_P (insn)) record_last_mem_set_info (insn); @@ -2548,7 +2561,20 @@ compute_kill_rd () for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) { - if (call_used_regs[regno]) + if ((call_used_regs[regno] + && regno != STACK_POINTER_REGNUM +#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM + && regno != HARD_FRAME_POINTER_REGNUM +#endif +#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM + && ! (regno == ARG_POINTER_REGNUM + && fixed_regs[regno]) +#endif +#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) + && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic) +#endif + && regno != FRAME_POINTER_REGNUM) + || global_regs[regno]) handle_rd_kill_set (insn, regno, bb); } } -- 2.11.4.GIT