This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
BUG in routine subst() in gcc/combine.c
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: BUG in routine subst() in gcc/combine.c
- From: Graham <grahams at rcp dot co dot uk>
- Date: Thu, 26 Aug 1999 13:58:35 +0100
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