This is the mail archive of the 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 regression caused by SUBREG validate

RTH and I discussed this yesterday.

The new validation code recently added for SUBREGs makes a SUBREG that
changes mode class valid only if the sizes are the same.  But if we are
doing a bitfield extraction from a SFmode value, we make a SUBREG of
SImode of that, but then if it's the proper bits, we try to make a QImode
SUBREG of that, which ICE's.  This fixes it by forcing the first SUBREG into
a register.

The ICE I saw was compiling the Ada RTS file s-stratt.adb.

Tested on x86_64-linux-gnu.

2004-11-26  Richard Kenner  <>

	* expmed.c (extract_bit_field): When extracting from non-integer mode,
	force a SUBREG into a register because we may be taking a further
	SUBREG of it.

*** expmed.c	23 Nov 2004 23:57:22 -0000	1.208
--- expmed.c	25 Nov 2004 21:32:22 -0000
*************** extract_bit_field (rtx str_rtx, unsigned
*** 1164,1174 ****
      if (imode != GET_MODE (op0))
! 	if (MEM_P (op0))
! 	  op0 = adjust_address (op0, imode, 0);
! 	else
! 	  {
! 	    gcc_assert (imode != BLKmode);
! 	    op0 = gen_lowpart (imode, op0);
! 	  }
--- 1164,1173 ----
      if (imode != GET_MODE (op0))
! 	op0 = gen_lowpart (imode, op0);
! 	/* If we got a SUBREG, force it into a register since we aren't going
! 	   to be able to do another SUBREG on it.  */
! 	if (GET_CODE (op0) == SUBREG)
! 	  op0 = force_reg (imode, op0);

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