From: Marius Bakke <marius@gnu.org>
To: 48368@debbugs.gnu.org
Subject: bug#48368: eq? problem at -O2 since Guile 3.0.5
Date: Tue, 11 May 2021 22:49:19 +0200 [thread overview]
Message-ID: <87pmxxhu7k.fsf@gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]
Hi!
I haven't been able to make a reproducer for this, but for illustrative
purposes, here is a code snippet that fails with -O2 on Guile 3.0.5 and
later (excerpt from GNU Shepherd):
(define (run-command socket-file action service args)
"Perform ACTION with ARGS on SERVICE, and display the result. Connect to
the daemon via SOCKET-FILE."
(with-system-error-handling
(let ((sock (open-connection socket-file))
(action* (if (and (eq? action 'detailed-status)
(memq service '(root shepherd)))
'status
action)))
;; Send the command.
(write-command (shepherd-command action* service #:arguments args)
sock)
https://git.savannah.gnu.org/cgit/shepherd.git/tree/modules/shepherd/scripts/herd.scm#n124
At -O2, (eq? action 'detailed-status) evaluates to true no matter what
symbol ACTION holds.
Interestingly, adding (pk action*) between LET and WRITE-COMMAND gives
the expected result and mitigates the problem(!).
There are other issues that can be observed by running the Shepherd test
suite (i.e. make -j4 check). With -O1 all pass.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
next reply other threads:[~2021-05-11 20:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 20:49 Marius Bakke [this message]
2021-05-24 8:14 ` bug#48368: reduced test case Andy Wingo
2021-05-24 12:19 ` bug#48368: thanks Andy Wingo
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=87pmxxhu7k.fsf@gnu.org \
--to=marius@gnu.org \
--cc=48368@debbugs.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).