This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Bootstrap currently broken due to unsigned comparison warning in calls.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Manfred Hollstein <mh at suse dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Jul 2005 11:59:21 -0400
- Subject: Re: [PATCH] Bootstrap currently broken due to unsigned comparison warning in calls.c
- References: <20050725153842.GD8469@saturn.hollstein.net.suse.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <firstname.lastname@example.org>
> * 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;
> - 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))