From: "Ludovic Courtès" <ludo@gnu.org>
To: 39947@debbugs.gnu.org
Subject: bug#39947: [3.0.0] Compiler mishandles literal bignums passed to ‘ash’
Date: Fri, 06 Mar 2020 15:00:29 +0100 [thread overview]
Message-ID: <8736aloa6a.fsf@gnu.org> (raw)
Hello,
Consider this:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (compile `(ash 1 ,(expt 2 64)) #:to 'value)
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure bytevector-u32-native-set!: Argument 3 out of range: 4294967296
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In system/base/compile.scm:
255:6 8 (compile _ #:from _ #:to _ #:env _ #:opts _)
183:32 7 (compile-fold _ _ #<module (#{ g251}#) 7f5f08f38500> ())
In language/cps/compile-bytecode.scm:
50:2 6 (emit-bytecode #<intmap 0-6> #<module (#{ g251}#) 7f5f08f38500> ())
686:23 5 (_ _ _ _)
In language/cps/intmap.scm:
519:5 4 (visit-branch #(#<cps (kfun () 0 6 1)> #<cps (kclause (() () #f () #f) 2)> #<cps (kargs () () (…> …) …)
In language/cps/compile-bytecode.scm:
50:34 3 (_ 3 #<cps (kargs (arg) (1) (continue 4 (primcall load-u64 18446744073709551616)))> _)
232:9 2 (compile-cont _ _)
In system/vm/assembler.scm:
800:0 1 (encode-X8_S24-AU32-BU32 #<<asm> buf: #u32(1 0 1048845 393528 62 2020111201 1835364909 560297583 1…> …)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)
scheme@(guile-user) [1]> %host-type
$2 = "x86_64-unknown-linux-gnu"
scheme@(guile-user) [1]> (version)
$3 = "3.0.0"
--8<---------------cut here---------------end--------------->8---
It seems to me that the problem is that the compiler emits
‘lsh/immediate’ (which expects a u64) instead of ‘lsh’.
Ludo’.
next reply other threads:[~2020-03-06 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 14:00 Ludovic Courtès [this message]
2021-11-07 18:57 ` bug#39947: [3.0.0] Compiler mishandles literal bignums passed to lloda
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=8736aloa6a.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=39947@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).