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] fix rtl enable-check faikure combine.c:simplify_shift_const


All,

The attached patch fixes a rtl-checking failure in combine.c:simplify_shift_const
that's a fallout from

2004-01-30 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>

        * combine.c (simplify_shift_const, case XOR): Be careful when
        commuting XOR with ASHIFTRT.

Bootstrapped i686-pc-linux-gnu all languages no regressions

Also builth8300-elf, xscale-elf, mn10300-elf crosses no regression

Graham

ChangeLog

2004-05-31 Graham Stott <graham.stott@btinternet.com>

	* combine.c(simplify_shift_const): Check shift amount is a
	CONST_INT.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.431
diff -c -p -r1.431 combine.c
*** combine.c	31 May 2004 06:59:47 -0000	1.431
--- combine.c	31 May 2004 15:51:37 -0000
*************** simplify_shift_const (rtx x, enum rtx_co
*** 8763,8771 ****
  	     logical expression, make a new logical expression, and apply
  	     the inverse distributive law.  This also can't be done
  	     for some (ashiftrt (xor)).  */
! 	  if (code != ASHIFTRT || GET_CODE (varop)!= XOR
! 	      || 0 <= trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
! 					  shift_mode))
  	    {
  	      rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode,
  					      XEXP (varop, 0), count);
--- 8763,8772 ----
  	     logical expression, make a new logical expression, and apply
  	     the inverse distributive law.  This also can't be done
  	     for some (ashiftrt (xor)).  */
! 	  if (GET_CODE (XEXP (varop, 1)) == CONST_INT
! 	     && !(code == ASHIFTRT && GET_CODE (varop) == XOR
! 	          && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
! 					     shift_mode)))
  	    {
  	      rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode,
  					      XEXP (varop, 0), count);
*************** simplify_shift_const (rtx x, enum rtx_co
*** 8776,8781 ****
--- 8777,8783 ----
  	      varop = apply_distributive_law (varop);
  
  	      count = 0;
+ 	      continue; 
  	    }
  	  break;
  

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