[pypy-commit] pypy default: Pfffff. This is enough to convince gcc 4.9 to produce correct code: do

arigo noreply at buildbot.pypy.org
Sun May 18 10:51:50 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r71563:3cf384e86ef7
Date: 2014-05-18 10:51 +0200
http://bitbucket.org/pypy/pypy/changeset/3cf384e86ef7/

Log:	Pfffff. This is enough to convince gcc 4.9 to produce correct code:
	do the "-" on the r_uint, not on the signed integer (because that
	might overflow).

diff --git a/rpython/rlib/rbigint.py b/rpython/rlib/rbigint.py
--- a/rpython/rlib/rbigint.py
+++ b/rpython/rlib/rbigint.py
@@ -177,7 +177,7 @@
 
         if intval < 0:
             sign = -1
-            ival = r_uint(-intval)
+            ival = -r_uint(intval)
         elif intval > 0:
             sign = 1
             ival = r_uint(intval)


More information about the pypy-commit mailing list