int(long(-sys.maxint-1)) fails on Linux

Chad Netzer chad at vision.arc.nasa.gov
Fri Jul 23 22:48:52 EDT 1999


Tim Peters wrote:

> [Chad Netzer]
> > ...
> > Here is some assembly of the same region, compiled with the -O1
> > flag, which DOES exhibit the incorrect behavior.  Notice that it is
> > quite different from the previous code,
>
> Yes, but despite being wrong, it's much faster <wink>.

Hey that's what I thought too. :).

>
> So it's as if "x << 1" had never been computed (which the lea does, btw --
> it's tricky!) or tested against 0.

Yeah, I noticed that the test seemed to be missing, and that lea probably shouldn't
set any condition codes (and as you point out, it would be very bad if it did).  I
am curious as to how the x<<1 is computed be lea (I don't understand the
0x0(,%edx,2),%eax notation...


> Yup!  You should report it to "them", of course -- such things rarely fix
> themselves ...

Naturally; Since Oliver seems to have been able to pass it on to some PGCC personnel
for comment, I'll see that the Mandrake persons know about it (at the very least, I'll
post it to their support lists for others trying to use Python 1.5.2 w/ Mandrake 6)

Chad







More information about the Python-list mailing list