This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: suggest assert wide_int larger than hashval_t
- From: Ian Lance Taylor <iant at google dot com>
- To: Jay K <jay dot krell at cornell dot edu>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Mon, 19 Jul 2010 00:36:06 -0700
- Subject: Re: suggest assert wide_int larger than hashval_t
- References: <COL101-W384F14DEBD85F08AC2602EE6BF0@phx.gbl>
Jay K <jay.krell@cornell.edu> 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