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]

Re: [PATCH] Bootstrap currently broken due to unsigned comparison warning in calls.c


On Mon, Jul 25, 2005 at 05:38:42PM +0200, Manfred Hollstein wrote:
> Hi there,
> 
> bootstrap is currently broken:
> 
>   ../../gcc-20050725/gcc/calls.c: In function 'store_one_arg':
>   ../../gcc-20050725/gcc/calls.c:4101: warning: comparison between signed and unsigned
> 
> This has been introduced by Jakub's patch which is more-or-less a copy
> of similar code several lines above. The for-loop's termination test is
> different, though. Assuming that "arg->locate.size.constant" does not
> carry negative values, the patch below would obviously be correct; I
> don't know, however, if that assumption is correct.

Oops, sorry.  Not sure why -Werror has not been used in my bootstrap
this time, will investigate.
Anyway, more correct would be probably using unsigned HOST_WIDE_INT k;
and casting to (unsigned HOST_WIDE_INT).

> 2005-07-25  Manfred Hollstein  <mh@suse.com>
> 
> 	* calls.c (store_one_arg): Fix unsigned comparison warning.
> 
> diff -rup -x CVS -x RCS -x '*.o' -x '*.info*' -x '*.elc' -x '*.dvi' -x '*.orig' -x '*~' -x version.el gcc-20050725.orig/gcc/calls.c gcc-20050725/gcc/calls.c
> --- gcc-20050725.orig/gcc/calls.c	2005-07-25 12:00:38.386535155 +0200
> +++ gcc-20050725/gcc/calls.c	2005-07-25 17:23:19.385482931 +0200
> @@ -4098,7 +4098,7 @@ store_one_arg (struct arg_data *arg, rtx
>  #ifdef ARGS_GROW_DOWNWARD
>  	  i = -i - arg->locate.size.constant;
>  #endif
> -	  for (k = 0; k < arg->locate.size.constant; k++)
> +	  for (k = 0; k < (unsigned int) arg->locate.size.constant; k++)
>  	    if (i + k < stored_args_map->n_bits
>  		&& TEST_BIT (stored_args_map, i + k))
>  	      {


	Jakub


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