This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix typo in rtlanal.c dead_or_set_regno_p


All,

This typo showed up as a enable-checking failure building d30v-elf target.

The problem is in this extract of code from dead_or_set_regno_p.

-------------------------------------------
  pattern = PATTERN (insn);

  if (GET_CODE (pattern) == COND_EXEC)
    pattern = COND_EXEC_CODE (pattern);

  if (GET_CODE (pattern) == SET)
    {
      rtx dest = SET_DEST (PATTERN (insn));
--------------------------------------------

If the insn is a COND_EXEC and it's CODE_EXEC_CODE is a SET then
then we end up passing the wring rtx pattern to SET_DEST.

The fix is obvious we need to pass the posilibly updated pattern to the
SET_DEST and not the original insns's PATTERN.

I have only seen this enable-checking abort trigger on d30v-elf target, all
the other targets I've built i686-pc-linux-gnu, arm-elf, v850-elf, ip2k-elf,
xscale-elf, h8300-elf, mn10300-elf, xstormy16-elf, sh-ehf, mips-elf or
powerpc-eabi dont't trigger this abort.

Ok for mainline

Graham

ChangeLog

       * rtlanal.c (dead_or_set_regno_p): Fix typo.

---------------------------------------------------------------------------
Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.138
diff -c -p -r1.138 rtlanal.c
*** rtlanal.c   28 Jul 2002 02:11:05 -0000      1.138
--- rtlanal.c   1 Aug 2002 22:46:43 -0000
*************** dead_or_set_regno_p (insn, test_regno)
*** 1798,1804 ****

    if (GET_CODE (pattern) == SET)
      {
!       rtx dest = SET_DEST (PATTERN (insn));

        /* A value is totally replaced if it is the destination or the
         destination is a SUBREG of REGNO that does not change the number of
--- 1798,1804 ----

    if (GET_CODE (pattern) == SET)
      {
!       rtx dest = SET_DEST (pattern);

        /* A value is totally replaced if it is the destination or the
         destination is a SUBREG of REGNO that does not change the number of
----------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]