Port-bebox archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

possible bug in clock.c



I think I may have found a bug having to do with
/usr/src/sys/arch/bebox/bebox/clock.c.

I was getting a compiler error on line 166, in delay():

tb = mftb();
tb += (n * 1000 + ns_per_tick - 1) / ns_per_tick;
tbh = tb >> 32;

The compiler/assembler didn't like that last line, it complained that
the shift was out of range (0-31).  Weird, I know, since tb is
supposed to be a quad, but anyway...

When I changed the last line to the following:

tbh = tb >> 31;
tbh >>= 1;

then it compiled fine.

This seems likely to be a bug in the C compiler.

--Mirian



Home | Main Index | Thread Index | Old Index