GNU bug report logs - #39947
[3.0.0] Compiler mishandles literal bignums passed to ‘ash’

Previous Next

Package: guile;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 6 Mar 2020 14:01:01 UTC

Severity: normal

To reply to this bug, email your comments to 39947 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#39947; Package guile. (Fri, 06 Mar 2020 14:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Fri, 06 Mar 2020 14:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guile <at> gnu.org
Subject: [3.0.0] Compiler mishandles literal bignums passed to
 ‘ash’
Date: Fri, 06 Mar 2020 15:00:29 +0100
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’.




Information forwarded to bug-guile <at> gnu.org:
bug#39947; Package guile. (Sun, 07 Nov 2021 18:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 39947 <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: 39947 <at> debbugs.gnu.org
Subject: Re: [3.0.0] Compiler mishandles literal bignums passed to
Date: Sun, 7 Nov 2021 19:57:58 +0100
Related: https://debbugs.gnu.org/50609





This bug report was last modified 3 years and 218 days ago.

Previous Next


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