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]
Other format: [Raw text]

[PATCH] PR24952: Tighten GET_CODE checks in try_combine


The following patch should resolve PR middle-end/24952 which is an
RTL-checking ICE on powerpc64 when compiling some altivec testcases
in the testsuite.  The problem is that although it's documented
that a PARALLEL can contain several types of RTL expression, the
problematic test in combine was assuming we could call SET_DEST on
anything that wasn't a USE.  The patch below tightens this test by
correctly checking whether the parallel conatains either a SET or
a CLOBBER.


The following patch has been tested on both powerpc64-unknown-linux-gnu
and i686-pc-linux-gnu, with a full "make bootstrap", all default
languages, and regression tested with a top-level "make -k check" with
no new failures.

Committed to mainline as 111425.



2006-02-24  Roger Sayle  <roger@eyesopen.com>

	PR middle-end/24952
	* combine.c (try_combine): Explicitly check whether GET_CODE is
	a SET or a CLOBBER, instead on checking that it isn't a USE.


Index: combine.c
===================================================================
*** combine.c	(revision 111241)
--- combine.c	(working copy)
*************** try_combine (rtx i3, rtx i2, rtx i1, int
*** 3123,3129 ****
      if (i3_subst_into_i2)
        {
  	for (i = 0; i < XVECLEN (PATTERN (i2), 0); i++)
! 	  if (GET_CODE (XVECEXP (PATTERN (i2), 0, i)) != USE
  	      && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, i)))
  	      && SET_DEST (XVECEXP (PATTERN (i2), 0, i)) != i2dest
  	      && ! find_reg_note (i2, REG_UNUSED,
--- 3123,3130 ----
      if (i3_subst_into_i2)
        {
  	for (i = 0; i < XVECLEN (PATTERN (i2), 0); i++)
! 	  if ((GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == SET
! 	       || GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == CLOBBER)
  	      && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, i)))
  	      && SET_DEST (XVECEXP (PATTERN (i2), 0, i)) != i2dest
  	      && ! find_reg_note (i2, REG_UNUSED,


Roger
--


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