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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Ludovic Courtès <ludo@HIDDEN>; dated Fri, 6 Mar 2020 14:01:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Mar 2020 14:00:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 06 09:00:37 2020
Received: from localhost ([127.0.0.1]:44252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jADWn-0007mL-D1
	for submit <at> debbugs.gnu.org; Fri, 06 Mar 2020 09:00:37 -0500
Received: from lists.gnu.org ([209.51.188.17]:44791)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jADWl-0007mD-Bc
 for submit <at> debbugs.gnu.org; Fri, 06 Mar 2020 09:00:36 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38563)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>) id 1jADWj-00013l-Tk
 for bug-guile@HIDDEN; Fri, 06 Mar 2020 09:00:35 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49053)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1jADWj-0001S6-Q6
 for bug-guile@HIDDEN; Fri, 06 Mar 2020 09:00:33 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60256 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1jADWh-0005MA-FV
 for bug-guile@HIDDEN; Fri, 06 Mar 2020 09:00:32 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: bug-guile@HIDDEN
Subject: [3.0.0] Compiler mishandles literal bignums passed to
 =?utf-8?B?4oCYYXNo4oCZ?=
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 17 =?utf-8?Q?Vent=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 06 Mar 2020 15:00:29 +0100
Message-ID: <8736aloa6a.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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 () () (=E2=80=A6> =E2=80=A6) =E2=80=A6)
In language/cps/compile-bytecode.scm:
    50:34  3 (_ 3 #<cps (kargs (arg) (1) (continue 4 (primcall load-u64 184=
46744073709551616)))> _)
    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=E2=80=A6> =E2=80=A6)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)
scheme@(guile-user) [1]> %host-type
$2 =3D "x86_64-unknown-linux-gnu"
scheme@(guile-user) [1]> (version)
$3 =3D "3.0.0"
--8<---------------cut here---------------end--------------->8---

It seems to me that the problem is that the compiler emits
=E2=80=98lsh/immediate=E2=80=99 (which expects a u64) instead of =E2=80=98l=
sh=E2=80=99.

Ludo=E2=80=99.




Acknowledgement sent to Ludovic Courtès <ludo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#39947; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 6 Mar 2020 14:15:02 UTC

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