GNU bug report logs - #39997
High CPU load and no return value with 3.0.0

Previous Next

Package: guile;

Reported by: Roel Janssen <roel <at> gnu.org>

Date: Mon, 9 Mar 2020 12:14:02 UTC

Severity: normal

Merged with 39251

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Roel Janssen <roel <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#39251: closed ([3.0.0] At -O2, top-level definitions not
 evaluated in order?)
Date: Wed, 11 Mar 2020 14:12:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 11 Mar 2020 15:11:48 +0100
with message-id <50786c56cd6b9632cdfb6e2c2f95e97c1758591d.camel <at> gnu.org>
and subject line Re: bug#39997: High CPU load and no return value with 3.0.0
has caused the debbugs.gnu.org bug report #39997,
regarding [3.0.0] At -O2, top-level definitions not evaluated in order?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
39997: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39997
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-Guix <at> gnu.org
Subject: [3.0.0] At -O2, top-level definitions not evaluated in order?
Date: Thu, 23 Jan 2020 10:51:20 +0100
Hello!

Guile-Lib’s md5.scm does something like:

--8<---------------cut here---------------start------------->8---
(define f-ash ash)

(define (ash x n)
  (modulo (f-ash x n) #x100000000))
--8<---------------cut here---------------end--------------->8---

At -O0 and -O1, this has the desired effect: ‘f-ash’ is an alias for
(@ (guile) ash).

However, at -O2 and above, ‘f-ash’ is eq? to the ‘ash’ defined right
below it.

This seems to contradict R5RS (info "(r5rs) Top level definitions").

Thoughts?

Ludo’.


[Message part 3 (message/rfc822, inline)]
From: Roel Janssen <roel <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39997-close <at> debbugs.gnu.org
Subject: Re: bug#39997: High CPU load and no return value with 3.0.0
Date: Wed, 11 Mar 2020 15:11:48 +0100
On Wed, 2020-03-11 at 15:05 +0100, Ludovic Courtès wrote:
> Roel Janssen <roel <at> gnu.org> skribis:
> 
> > On Wed, 2020-03-11 at 12:07 +0100, Ludovic Courtès wrote:
> 
> [...]
> 
> > > The Guix package has this patch:
> > > 
> > >         '(begin
> > >            ;; Work around miscompilation on Guile 3.0.0 at -O2:
> > >            ;; <https://bugs.gnu.org/39251>;;.
> > >            (substitute* "src/md5.scm"
> > >              (("\\(define f-ash ash\\)")
> > >               "(define f-ash (@ (guile) ash))\n")
> > >              (("\\(define f-add \\+\\)")
> > >               "(define f-add (@ (guile) +))\n"))
> > >            #t)
> > > 
> > > It’s very likely that you’re hitting this problem.
> > 
> > Yes!  Thanks for sharing this fix.
> > I applied the same changes to my code and now I don't encounter the
> > bug
> > anymore.
> > 
> > I tested the patched code with both guile-2.2 and guile-3.0.  Do
> > you
> > know whether this will also work with guile-2.0?  (I'd like to keep
> > things compatible with guile-2.0 for a few more years).
> 
> Yes, the change above also works for Guile 2.0.

Thanks for the confirmation.  I'm closing this bug, as it is basically
a duplicate of #39251.

Kind regards,
Roel Janssen




This bug report was last modified 5 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.