This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author srid
Recipients pitrou, ronaldoussoren, srid
Date 2010-05-11.18:04:29
SpamBayes Score 0.0020191155
Marked as misclassified No
Message-id <1273601071.81.0.456232643808.issue8683@psf.upfronthosting.co.za>
In-reply-to
Content
I am using "cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]" .. with the following options.

cc +DD64 -Ae -D_REENTRANT +Z -c  -g -DNDEBUG -O  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/gcmodule.o Modules/gcmodule.c

So that is +O2 level.

----

Interestingly the following patch fixes the bug, and shows that this is a optimization bug in HPUX compiler:

diff -r 549fd95a5eb9 Modules/gcmodule.c
--- a/Modules/gcmodule.c        Mon May 10 23:51:33 2010 +0200
+++ b/Modules/gcmodule.c        Tue May 11 11:02:52 2010 -0700
@@ -984,7 +984,8 @@
     /* Find the oldest generation (highest numbered) where the count
      * exceeds the threshold.  Objects in the that generation and
      * generations younger than it will be collected. */
-    for (i = NUM_GENERATIONS-1; i >= 0; i--) {
+    i = NUM_GENERATIONS-1;
+    while (i>=0){
         if (generations[i].count > generations[i].threshold) {
             /* Avoid quadratic performance degradation in number
                of tracked objects. See comments at the beginning
@@ -996,6 +997,7 @@
             n = collect(i);
             break;
         }
+       i--;
     }
     return n;
 }

----

I will try to use a different optimization level now.
History
Date User Action Args
2010-05-11 18:04:31sridsetrecipients: + srid, ronaldoussoren, pitrou
2010-05-11 18:04:31sridsetmessageid: <1273601071.81.0.456232643808.issue8683@psf.upfronthosting.co.za>
2010-05-11 18:04:30sridlinkissue8683 messages
2010-05-11 18:04:29sridcreate