[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Mark Dickinson
Mark Dickinson added the comment: Okay, all fixed here. Let's add any further signed overflow issues to the issue #1621 discussion. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5a1cb8506cea by Mark Dickinson in branch '2.7': Backport issue #12973 itertools fix from 3.x. http://hg.python.org/cpython/rev/5a1cb8506cea -- ___ Python tracker

[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset b378864d8ff3 by Mark Dickinson in branch '3.2': Issue #12973: Fix itertools bug caused by signed integer overflow. Thanks Stefan Krah. http://hg.python.org/cpython/rev/b378864d8ff3 New changeset 18eec56bcf29 by Mark Dickinson in branch 'default':

[issue12973] int_pow() implementation is incorrect

2011-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset f8280cf63d9e by Mark Dickinson in branch '2.7': Backport issue #12973 list_repeat fix from 3.x. http://hg.python.org/cpython/rev/f8280cf63d9e -- ___ Python tracker __

[issue12973] int_pow() implementation is incorrect

2011-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 99b808c94834 by Mark Dickinson in branch '3.2': Issue #12973: Fix undefined-behaviour-inducing overflow check in list_repeat. http://hg.python.org/cpython/rev/99b808c94834 New changeset 2dbd5870de0b by Mark Dickinson in branch 'default': Merge issu

[issue12973] int_pow() implementation is incorrect

2011-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 07efe83795b0 by Mark Dickinson in branch '2.7': Issue #12973: Fix int.__pow__ overflow checks that invoked undefined behaviour, thereby producing incorrect results on Clang. http://hg.python.org/cpython/rev/07efe83795b0 -- nosy: +python-de

[issue12973] int_pow() implementation is incorrect

2011-09-16 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: duplicate -> stage: committed/rejected -> commit review ___ Python tracker ___ ___ Python-

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson wrote: > Well, they're all in the standard, which is publicly available. I have the real thing. :) > The correctness of the patch depends on: > (2) an assumption that the C implementation will never raise an > 'implementation-defined' signal

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Mark Dickinson
Mark Dickinson added the comment: Those two patches (for listobject and itertools) look fine to me. -- ___ Python tracker ___ ___ Pyt

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Mark Dickinson
Mark Dickinson added the comment: > an assumption that the C implementation will never raise an > 'implementation-defined' signal (C99 6.3.1.3p3). Sorry, this should have been more explicit: "will never raise ... when converting long to unsigned long" -- _

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Mark Dickinson
Mark Dickinson added the comment: Gah; did I really misnumber that issue patch? Sorry. > Mark, did you write those rules down somewhere? Well, they're all in the standard, which is publicly available. (Or at least, a draft of the standard that's pretty much interchangeable with the real th

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Stefan Krah
Stefan Krah added the comment: With issue12975.diff, listobject_overflow.diff and itertools_overflow.diff I don't get any more failures. Also, of course issue12975.diff looks correct to me if we assume: http://mail.python.org/pipermail/python-dev/2009-December/094392.html http://yarchive.net/

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file23165/itertools_overflow.diff ___ Python tracker ___ ___ Python-bugs-list mail

[issue12973] int_pow() implementation is incorrect

2011-09-15 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file23164/listobject_overflow.diff ___ Python tracker ___ ___ Python-bugs-list mai

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Stefan Krah
Stefan Krah added the comment: == CPython 2.7.2+ (2.7:a698ad2741da+, Sep 15 2011, 00:17:28) [GCC 4.2.1 Compatible Clang 3.0 (trunk 139637)] == FreeBSD-8.0-RELEASE-amd64-64bit-ELF little-endian == /usr/home/stefan/pydev/cpython/build/test_python_71451 With clang 3.0 from trunk, the pow() fa

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread STINNER Victor
STINNER Victor added the comment: Aaaah, int_pow. I was testing Python 3.3. I tested Python 2.7 with clang 2.8, optimization level at -03 and without -fwrapv... I'm still unable to reproduce the issue. It's maybe an optimization introduced by clang 2.9. -- This issue remembers me the great

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Mark Dickinson
Mark Dickinson added the comment: I've got Clang from MacPorts, on OS X 10.6.8. iwasawa:cpython mdickinson$ clang --version clang version 2.9 (tags/RELEASE_29/final) Target: x86_64-apple-darwin10 Thread model: posix Without the patch (and before the -fwrapv inclusion), I get the following fai

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread STINNER Victor
STINNER Victor added the comment: > Thanks Victor; I just managed to install Clang, > and it looks I can reproduce the failures. What is your clang version? I ran ./python -m test -v test_long to check the issue. -- ___ Python tracker

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks Victor; I just managed to install Clang, and it looks I can reproduce the failures. I'm testing right now to see if the patch fixes them all... -- ___ Python tracker

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread STINNER Victor
STINNER Victor added the comment: I removed -fwrapv from configure and Makefile, but I'm unable to reproduce the issue with clang 2.8 on x86_64 (Fedora 15). -- nosy: +haypo ___ Python tracker

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a simple patch. Is anyone in a good position to see if this fixes the tests failures for Clang (without the fwrapv flag)? -- keywords: +patch Added file: http://bugs.python.org/file23155/issue12975.diff ___

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: Notice that this "signed overflow" issue is also tracked as #1621. I don't mind keeping this issue open, though - it's unlikely that #1621 will be fixed within this decade. unless somebody does some heroic effort. -- nosy: +loewis __

[issue12973] int_pow() implementation is incorrect

2011-09-14 Thread Mark Dickinson
Mark Dickinson added the comment: Reopening and assigning to me; it would be good to fix this in intobject.c as well as adding the Clang-specific -fwrapv fix. -- assignee: -> mark.dickinson nosy: +mark.dickinson status: closed -> open ___ Python t

[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Stefan Krah
Stefan Krah added the comment: I can reproduce your results with a recent clang. gcc has similar optimization behavior, but for gcc ./configure automatically adds -fwrapv, which prevents the incorrect results. I'm closing this as a duplicate of #11149. -- resolution: -> duplicate stag

[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Stefan Krah
Stefan Krah added the comment: I think this is related to issue #11149. Can you try compiling with -fwrapv? -- nosy: +skrah ___ Python tracker ___ __

[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Adam
New submission from Adam : int_pow() (from Objects/intobject.c) shows incorrect results when Python is compiled with Clang (llvm.org); long story short: int_pow() function should use 'unsigned long' type instead of 'long' or some code gets optimised out. Please, refer to this bug report to fin