|Java static analysis tool (JavaChecker) has been released firstname.lastname@example.org (Roni Hursti) (2002-11-17)|
|Re: Java static analysis tool (JavaChecker) has been released email@example.com (Sander Vesik) (2002-12-01)|
|Re: Java static analysis tool (JavaChecker) has been released firstname.lastname@example.org (Joachim Durchholz) (2002-12-03)|
|From:||"Joachim Durchholz" <email@example.com>|
|Date:||3 Dec 2002 00:42:13 -0500|
|Posted-Date:||03 Dec 2002 00:42:13 EST|
> [Right shifting three bits is not the same as dividing by 8. That's a
> famous optimizer bug from way back. -John]
Is it still a bug if it's an arithmetic shift on a two's complement machine?
One thing that I can think of is how your integer division rounds for
negative numbers: towards zero or towards negative infinity. If it's
towards negative infinity, an arithmetic right shift should handle this
correctly (if I did my math correctly).
Are there other factors?
[That's the problem. If you know that the dividend is non-negative,
shifting is OK. -John]
Return to the
Search the comp.compilers archives again.