This is the mail archive of the gcc@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: suggest assert wide_int larger than hashval_t


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


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