unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: guile-devel@gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [PATCH devel 2/6] Work around Guile 3.0.0 miscompilation at -O2.
Date: Thu,  4 Mar 2021 21:35:20 -0500	[thread overview]
Message-ID: <20210305023524.15317-2-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20210305023524.15317-1-maxim.cournoyer@gmail.com>

From: Ludovic Courtès <ludo@gnu.org>

This bug would cause the test suite to hang and fully use one CPU core
and slowly consume all the memory.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
 src/md5.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/md5.scm b/src/md5.scm
index c30ef2c..48dfa63 100644
--- a/src/md5.scm
+++ b/src/md5.scm
@@ -68,8 +68,10 @@ referenced C implementation into Scheme.
 
 ;; Some math basics.
 
-(define f-add +)
-(define f-ash ash)
+;; Work around miscompilation on Guile 3 at -O2:
+;; <https://bugs.gnu.org/39251>.
+(define f-add (@ (guile) +))            ;(define f-add +)
+(define f-ash (@ (guile) ash))          ;(define f-ash ash)
 
 (define (+ . args)
   (modulo (apply f-add args) #x100000000))
-- 
2.30.1




  reply	other threads:[~2021-03-05  2:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05  2:14 [PATCH devel 0/6] Parameterize the parent constraints in htmlprag & varia Maxim Cournoyer
2021-03-05  2:35 ` [PATCH devel 1/6] Revert "When using guile-3.0, compile src/md5.scm using -O0" Maxim Cournoyer
2021-03-05  2:35   ` Maxim Cournoyer [this message]
2021-03-05  2:35   ` [PATCH devel 3/6] Add a HACK file Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 4/6] htmlprag: Allow users to parameterize the parent constraints Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 5/6] build: Add support for cross-compilation Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 6/6] configure.ac: Standardize default installation directory Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305023524.15317-2-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).