Unreviewed patches: avoid warnings

Jan van Male#84776 vanmale@fenk.wau.nl
Fri Aug 24 07:34:00 GMT 2001


Hi all,

These two patches have been unreviewed:
http://gcc.gnu.org/ml/gcc-patches/2001-08/msg00445.html
http://gcc.gnu.org/ml/gcc-patches/2001-08/msg00677.html

The last patch will no longer apply cleanly: the change to expmed.c now 
gives a conflict.  In a recent change, INTVAL was cast to `unsigned int'.  
I believe this is not safe since INTVAL is a HOST_WIDE_INT.  The attached 
patch fixes this.  Bootstrapped i686-pc-linux-gnu.

ChangeLog:
2001-08-24  Jan van Male  <jan.vanmale@fenk.wau.nl>

	* expmed.c (expand_shift): Cast INTVAL to unsigned HOST_WIDE_INT instead 
	of unsigned int.


Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.87
diff -c -3 -p -r1.87 expmed.c
*** expmed.c	2001/08/22 14:35:03	1.87
--- expmed.c	2001/08/24 13:37:32
*************** expand_shift (code, mode, shifted, amoun
*** 2040,2046 ****
  
  	  if (temp == 0 && GET_CODE (op1) == CONST_INT
  	      && INTVAL (op1) > 0
! 	      && (unsigned int) INTVAL (op1) < GET_MODE_BITSIZE (mode))
  	    temp = expand_binop (mode,
  				 left ? rotr_optab : rotl_optab,
  				 shifted, 
--- 2040,2046 ----
  
  	  if (temp == 0 && GET_CODE (op1) == CONST_INT
  	      && INTVAL (op1) > 0
! 	      && (unsigned HOST_WIDE_INT) INTVAL (op1) < GET_MODE_BITSIZE (mode))
  	    temp = expand_binop (mode,
  				 left ? rotr_optab : rotl_optab,
  				 shifted, 



More information about the Gcc-patches mailing list