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]

[RFA] fold-const.c warning


	Appended is a patch to address at least one of the warnings in
gcc-3.0 branch.  It looks like both types are appropriate for their other
uses. 

	Kaveh, are you taking a special interest in these types of
warnings again?

David


	* fold-const.c (div_and_rond_double): Cast carry to signed for
	comparison.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fold-const.c,v
retrieving revision 1.146.2.2
diff -c -p -r1.146.2.2 fold-const.c
*** fold-const.c	2001/02/23 12:29:49	1.146.2.2
--- fold-const.c	2001/02/23 15:56:19
*************** div_and_round_double (code, uns,
*** 678,684 ****
  
  	  /* If quo_est was high by one, then num[i] went negative and
  	     we need to correct things.  */
! 	  if (num[num_hi_sig] < carry)
  	    {
  	      quo_est--;
  	      carry = 0;		/* add divisor back in */
--- 678,684 ----
  
  	  /* If quo_est was high by one, then num[i] went negative and
  	     we need to correct things.  */
! 	  if (num[num_hi_sig] < (HOST_WIDE_INT) carry)
  	    {
  	      quo_est--;
  	      carry = 0;		/* add divisor back in */


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