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]

BUG in routine subst() in gcc/combine.c


Hi

The routine subst() in gcc/combine.c has the following block of code

      len = GET_RTX_LENGTH (code);
      fmt = GET_RTX_FORMAT (code);

      /* We don't need to process a SET_DEST that is a register, CC0,
         or PC, so set up to skip this common case.  All other cases
         where we want to suppress replacing something inside a
         SET_SRC are handled via the IN_DEST operand.  */
      if (code == SET
          && (GET_CODE (SET_DEST (x)) == REG
              || GET_CODE (SET_DEST (x)) == CC0
              || GET_CODE (SET_DEST (x)) == PC))
          fmt = "ie";

      /* Get the mode of operand 0 in case X is now a SIGN_EXTEND of a
	 constant.  */
      if (fmt[0] == 'e')
	op0_mode = GET_MODE (XEXP (x, 0));

      for (i = 0; i < len; i++)

Should the code which sets `fmt' to "ie" ALSO set `len' to 2, otherwise
the for loop will process the wrong # of entries.

Graham


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