From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#42060: [3.0.4] Incorrect =?UTF-8?Q?=E2=80=98eqv=3F=E2=80=99?= reduction in =?UTF-8?Q?64=E2=86=9232-bit?= cross-compilation Date: Fri, 26 Jun 2020 16:04:34 +0200 Message-ID: <87zh8pncst.fsf@inria.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129364"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: "Jan \(janneke\) Nieuwenhuizen" To: 42060@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Jun 26 16:06:27 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joozq-000XUi-Du for guile-bugs@m.gmane-mx.org; Fri, 26 Jun 2020 16:06:26 +0200 Original-Received: from localhost ([::1]:35844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joozp-0000OE-8l for guile-bugs@m.gmane-mx.org; Fri, 26 Jun 2020 10:06:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jooyU-0006tl-MO for bug-guile@gnu.org; Fri, 26 Jun 2020 10:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jooyU-00052Z-BA; Fri, 26 Jun 2020 10:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jooyU-0002m5-54; Fri, 26 Jun 2020 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: janneke@gnu.org, bug-guile@gnu.org Resent-Date: Fri, 26 Jun 2020 14:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42060 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org X-Debbugs-Original-Xcc: "Jan (janneke) Nieuwenhuizen" Original-Received: via spool by submit@debbugs.gnu.org id=B.159318028010631 (code B ref -1); Fri, 26 Jun 2020 14:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Jun 2020 14:04:40 +0000 Original-Received: from localhost ([127.0.0.1]:42925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jooy8-0002lP-5N for submit@debbugs.gnu.org; Fri, 26 Jun 2020 10:04:40 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jooy5-0002lH-Fn for submit@debbugs.gnu.org; Fri, 26 Jun 2020 10:04:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jooy5-0006Tb-8z for bug-guile@gnu.org; Fri, 26 Jun 2020 10:04:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39808) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jooy4-0004rW-VG for bug-guile@gnu.org; Fri, 26 Jun 2020 10:04:36 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35590 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jooy4-0004b6-IV for bug-guile@gnu.org; Fri, 26 Jun 2020 10:04:36 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 Messidor an 228 de la =?UTF-8?Q?R=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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9832 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, In , janneke found that cross-compiling an =E2=80=98eqv?=E2=80=99 form from x86_64 to i686 leads to= an incorrect =E2=80=98eqv?=E2=80=99 reduction (this was not the case in 3.0.2). Reprodu= cer: (lambda (i) (eqv? i #x6478696f)) Then cross-compile from x86_64 like this: guild compile -O3 --target=3Di586-pc-gnu -o bad.go reproducer.scm and compile natively on a 32-bit platform with: guild compile -O3 -o good.go reproducer.scm If you disassemble good.go and bad.go, the diff goes like this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- /tmp/good.asm 2020-06-26 15:56:35.671024432 +0200 +++ /tmp/bad.asm 2020-06-26 15:56:35.651024548 +0200 @@ -1,55 +1,39 @@ Disassembly of at #x98: - 0 (instrument-entry 16348) at eqv-reduction-bug.scm:1:0 + 0 (instrument-entry 16348) at /home/ludo/src/guile-debugging/eqv-reduction-bug.scm:1:0 2 (assert-nargs-ee/locals 1 0) ;; 1 slot (0 args) - 3 (make-non-immediate 0 16343) ;; # + 3 (make-non-immediate 0 16343) ;; # 5 (handle-interrupts) 6 (return-values) Disassembly of at #xb4: - 0 (instrument-entry 16351) at eqv-reduction-bug.scm:1:0 + 0 (instrument-entry 16351) at /home/ludo/src/guile-debugging/eqv-reduction-bug.scm:1:0 2 (assert-nargs-ee/locals 2 0) ;; 2 slots (1 arg) 3 (static-ref 1 16346) ;; 1685612911 - 5 (eq? 0 1) at eqv-reduction-bug.scm:2:2 - 6 (je 21) ;; -> L3 - 7 (immediate-tag=? 0 7 0) ;; heap-object? - 9 (jne 14) ;; -> L2 - 10 (heap-tag=? 0 127 23) ;; heap-number? - 12 (jne 11) ;; -> L2 - 13 (heap-numbers-equal? 0 1) - 14 (jne 5) ;; -> L1 - 15 (make-short-immediate 1 1028) ;; #t - 16 (reset-frame 1) ;; 1 slot - 17 (handle-interrupts) - 18 (return-values) + 5 (eq? 0 1) at /home/ludo/src/guile-debugging/eqv-reduction-bug.scm:2:2 + 6 (jne 5) ;; -> L1 + 7 (make-short-immediate 1 1028) ;; #t + 8 (reset-frame 1) ;; 1 slot + 9 (handle-interrupts) + 10 (return-values) L1: - 19 (make-short-immediate 1 4) ;; #f - 20 (reset-frame 1) ;; 1 slot - 21 (handle-interrupts) - 22 (return-values) -L2: - 23 (make-short-immediate 1 4) ;; #f - 24 (reset-frame 1) ;; 1 slot - 25 (handle-interrupts) - 26 (return-values) -L3: - 27 (make-short-immediate 1 1028) ;; #t - 28 (reset-frame 1) ;; 1 slot - 29 (handle-interrupts) - 30 (return-values) + 11 (make-short-immediate 1 4) ;; #f + 12 (reset-frame 1) ;; 1 slot + 13 (handle-interrupts) + 14 (return-values) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable IOW, bad.go reduced =E2=80=98eqv?=E2=80=99 to =E2=80=98eq?=E2=80=99. This might come from 7df3f3414bfb19a1bd7fbe29bc30a1ab28bf4319, perhaps with an issue of the time at which =E2=80=98target-most-positive-fixnum=E2= =80=99 is called, similar to what was fixed in a0b9d866380b04aff27dcbcf1e13051f3d9685ad. To be continued=E2=80=A6 Ludo=E2=80=99. --=-=-=--