Whoops. Accidentally hit "submit".
This is what dmd generates for `i > 0`:
----
neg EAX
shr EAX,01Fh
----
In D: `(-i) >> 31`.
That code assumes that negation always flips the sign bit. But it doesn't for `int.min`. `-int.min` is `int.min` again.
Comment #2 by schveiguy — 2018-01-27T14:56:23Z
Wow, this is really old. Tested all the way back to 2.040, still fails.