[issue10044] small int optimization

Mark Dickinson report at bugs.python.org
Thu Oct 7 23:36:32 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

> How is the compiler supposed to know whether a and b belong to the same
> array when compiling ptr_compare?

It doesn't need to know.  So long as the compiler can guarantee that its code will produce correct results in the case that a and b *do* both point to the same array, that's enough.  In other words, when producing code for ptr_compare, the compiler is allowed to *assume* that a and b point into the same array, and act accordingly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10044>
_______________________________________


More information about the Python-bugs-list mailing list