This is the mail archive of the gcc-bugs@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]

Coding eror in rtlanal.c:reg_set_last() (GCC 3.4 2004/01/21 snapshot).


Hello,

 In rtx reg_set_last (rtx x, rtx insn), we obtain a SET/CLOBBER of 'x' via:

 set = set_of (x, insn);

 But once we obtain 'set', we need to compute the value 'x' was assigned by:

 last_value = SET_SRC (set);

 (Not as is the case currently: last_value = SET_SRC (x);)

*** 1617,1623 ****
            rtx last_value;
            if (GET_CODE (set) != SET || SET_DEST (set) != x)
              return 0;
!           last_value = SET_SRC (x);
            if (CONSTANT_P (last_value)
                || ((GET_CODE (last_value) == REG
                     || GET_CODE (last_value) == SUBREG)
--- 1617,1623 ----
            rtx last_value;
            if (GET_CODE (set) != SET || SET_DEST (set) != x)
              return 0;
!           last_value = SET_SRC (set);
            if (CONSTANT_P (last_value)
                || ((GET_CODE (last_value) == REG
                     || GET_CODE (last_value) == SUBREG)

 ...else a seg-fault results on use of this function.

 Kindly validate. Request you to fix.

Thanks & Regards,
Anmol P. Paralkar


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