cc generated code bug
Andrew Koenig
ark at alice.UUCP
Tue Jul 2 06:04:14 AEST 1985
> When right-shifting an unsigned variable, the compiler generates an
> EXTZV instruction. If the shift count exceeds 32, a reserved operand
> fault occurs and the program gets an illegal instruction signal, instead
> of giving a null result.
> --
> Robbert van Renesse
> cogito at vu44.UUCP
This is not a bug. K&R, page 189: "The result [of a shift] is undefined
if the right operand is negative, or greater or equal to the length of
the object in bits."
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list