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 looks about the same in 4.5.0 except without const:
int shift = (sizeof (hashval_t) * CHAR_BIT);
Something is amiss here locally, for the types to be the same size.
But maybe add gcc_assert(sizeof(hashval_t) < sizeof(HOST_WIDE_INT),
outside the loop? It should be optimized away anyway.
Maybe I'd get -Werror but I use -disable-bootstrap.
Native compiler is gcc, but old.
Thanks,
- Jay