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]

[patch] combine.c if_then_else_cond() subreg modes



In emit-rtl.c, the comment for operand_subword says:

	MODE is the mode of OP in case it is a CONST_INT.

But, in if_then_else_cond, when passed (subreg:SI (reg:DI 42) 1), we
pass SImode as the "mode".  However, shouldn't we pass the mode of the
inner register (DImode)?  Because, if_then_else_cond, if it returns a
const_int into true0 or false0, will return one sized for the reg's
mode, not the subreg's mode.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.172
diff -p -3 -r1.172 combine.c
*** combine.c	2001/01/03 06:47:28	1.172
--- combine.c	2001/01/06 01:43:09
*************** if_then_else_cond (x, ptrue, pfalse)
*** 7418,7425 ****
  	  && GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) > UNITS_PER_WORD
  	  && (WORDS_BIG_ENDIAN || SUBREG_WORD (x) != 0))
  	{
! 	  true0 = operand_subword (true0, SUBREG_WORD (x), 0, mode);
! 	  false0 = operand_subword (false0, SUBREG_WORD (x), 0, mode);
  	}
        *ptrue = force_to_mode (true0, mode, ~(HOST_WIDE_INT) 0, NULL_RTX, 0);
        *pfalse
--- 7418,7425 ----
  	  && GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) > UNITS_PER_WORD
  	  && (WORDS_BIG_ENDIAN || SUBREG_WORD (x) != 0))
  	{
! 	  true0 = operand_subword (true0, SUBREG_WORD (x), 0, GET_MODE (SUBREG_REG (x)));
! 	  false0 = operand_subword (false0, SUBREG_WORD (x), 0, GET_MODE (SUBREG_REG (x)));
  	}
        *ptrue = force_to_mode (true0, mode, ~(HOST_WIDE_INT) 0, NULL_RTX, 0);
        *pfalse

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