suggest assert wide_int larger than hashval_t
Jay K
jay.krell@cornell.edu
Mon Jul 19 07:55:00 GMT 2010
It's "just" a warning, no "real" affects seen.
I patched my copy to say
hwi = ((hwi >> (shift - 1)) >> 1);
Thanks,
- Jay
----------------------------------------
> From: iant@google.com
> To: jay.krell@cornell.edu
> CC: gcc@gcc.gnu.org
> Subject: Re: suggest assert wide_int larger than hashval_t
> Date: Mon, 19 Jul 2010 00:36:06 -0700
>
> Jay K writes:
>
> > I get this in 4.3.5:
> >
> > ../../gcc/gcc/varasm.c: In function `const_rtx_hash_1':
> > ../../gcc/gcc/varasm.c:3387: warning: right shift count >= width of type
> >
> > ./include/hashtab.h:typedef unsigned int hashval_t;
> >
> > unsigned HOST_WIDE_INT hwi;
> > hashval_t h, *hp;
> > ...
> > const int shift = sizeof (hashval_t) * CHAR_BIT;
> > const int n = sizeof (HOST_WIDE_INT) / sizeof (hashval_t);
> > int i;
> >
> > h ^= (hashval_t) hwi;
> > for (i = 1; i < n; ++i)
> > {
> > hwi >>= shift; here
>
> It's not an actual problem, because the code is never executed in the
> case where right shift count >= width of type. Note that the loop
> starts at 1. If this is breaking bootstrap that it needs to be
> addressed one way or another, otherwise it's not too serious.
>
> Ian
More information about the Gcc
mailing list