This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
loop_regs_update patch to remove cruft
- From: Jim Wilson <wilson at tuliptree dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: 06 Sep 2003 22:26:55 -0700
- Subject: loop_regs_update patch to remove cruft
This fixes a problem I noticed while working on PR 11319.
In the olden days, a sequence could be either a PATTERN rtx, or a list of
insns. Nowadays, it can only be a list of insns. There is code in the
function loop_regs_update to handle the PATTERN case which is now obsolete.
After deleting the else clause, we can eliminate the if stmt and then delete
the redundant NULL_RTX check which gives me the following patch.
This was tested with an x86-linux bootstrap and make check. There were no
regressions. I also tested this by putting an abort in the else clause and
doing some builds, and never hit the abort.
I wrote this patch over a week ago, which was before I became a Specifix Inc
employee. I excluded it when signing the employee IP agreement. This is the
only pending pre-employment patch I have.
2003-09-06 James E Wilson <wilson@tuliptree.org>
* loop.c (loop_regs_update): Delete else clause for PATTERN rtx and
simplify.
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.469
diff -p -r1.469 loop.c
*** loop.c 30 Jul 2003 20:28:45 -0000 1.469
--- loop.c 7 Sep 2003 05:11:23 -0000
*************** loop_regs_update (const struct loop *loo
*** 7741,7765 ****
/* Update register info for alias analysis. */
! if (seq == NULL_RTX)
! return;
!
! if (INSN_P (seq))
{
! insn = seq;
! while (insn != NULL_RTX)
! {
! rtx set = single_set (insn);
! if (set && GET_CODE (SET_DEST (set)) == REG)
! record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
! insn = NEXT_INSN (insn);
! }
}
- else if (GET_CODE (seq) == SET
- && GET_CODE (SET_DEST (seq)) == REG)
- record_base_value (REGNO (SET_DEST (seq)), SET_SRC (seq), 0);
}
--- 7741,7756 ----
/* Update register info for alias analysis. */
! insn = seq;
! while (insn != NULL_RTX)
{
! rtx set = single_set (insn);
! if (set && GET_CODE (SET_DEST (set)) == REG)
! record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
! insn = NEXT_INSN (insn);
}
}
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com