* bug#39947: [3.0.0] Compiler mishandles literal bignums passed to ‘ash’
@ 2020-03-06 14:00 Ludovic Courtès
2021-11-07 18:57 ` bug#39947: [3.0.0] Compiler mishandles literal bignums passed to lloda
0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2020-03-06 14:00 UTC (permalink / raw)
To: 39947
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’.
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#39947: [3.0.0] Compiler mishandles literal bignums passed to
2020-03-06 14:00 bug#39947: [3.0.0] Compiler mishandles literal bignums passed to ‘ash’ Ludovic Courtès
@ 2021-11-07 18:57 ` lloda
0 siblings, 0 replies; 2+ messages in thread
From: lloda @ 2021-11-07 18:57 UTC (permalink / raw)
To: 39947
Related: https://debbugs.gnu.org/50609
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-07 18:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 14:00 bug#39947: [3.0.0] Compiler mishandles literal bignums passed to ‘ash’ Ludovic Courtès
2021-11-07 18:57 ` bug#39947: [3.0.0] Compiler mishandles literal bignums passed to lloda
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).