Stefan Krah <stefan-use...@bytereef.org> added the comment:

My rationale was something like this: If a compiler optimizes away signed
arithmetic overflow, this particular comparison will most likely be in
the set of optimizations, since it seems like low hanging fruit.

Of course it doesn't guarantee wrapping behavior in general.

> BTW, I suspect that the reason there were no related test failures
> with the Intel compiler is that most of the problems in the Python
> code stem from multiplications rather than additions.  Probably icc
> isn't sophisticated enough to optimize those multiplication + division
> checks away.

Yes, I think that's it.

> Seems like we should probably be looking for an icc flag that forces
> wrapping on signed integer overflow.

I didn't find any in the man page or search engines.

> In the long run, it would still be good to eliminate the need
> for fwrapv and the like;  it can have a significant performance hit.

I agree, but it's progressing quite slowly. ;)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to