New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

sum() assumes that an arithmetic operation on signed longs will wrap modulo 
2**(bits_in_long) on overflow.  However, signed overflow causes undefined 
behaviour according  to the C standards (e.g., C99 6.5, para. 5), and gcc is 
known to assume that signed overflow never occurs in correct code, and to make 
use of this assumption when optimizing.

See also issue7406.

----------
components: Interpreter Core
messages: 341374
nosy: mark.dickinson, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: sum() relies on C signed overflow behaviour
type: behavior
versions: Python 3.7, Python 3.8

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

Reply via email to