GNU bug report logs - #42060
[3.0.4] Incorrect ‘eqv?’ reduction in 64→32-bit cross-compilation

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; Severity: important; Reported by: Ludovic Courtès <ludo@HIDDEN>; dated Fri, 26 Jun 2020 14:05:01 UTC; Maintainer for guile is bug-guile@HIDDEN.
Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 26 Jun 2020 14:04:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 26 10:04:40 2020
Received: from localhost ([127.0.0.1]:42925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jooy8-0002lP-5N
	for submit <at> debbugs.gnu.org; Fri, 26 Jun 2020 10:04:40 -0400
Received: from lists.gnu.org ([209.51.188.17]:57486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jooy5-0002lH-Fn
 for submit <at> debbugs.gnu.org; Fri, 26 Jun 2020 10:04:39 -0400
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 <ludo@HIDDEN>) id 1jooy5-0006Tb-8z
 for bug-guile@HIDDEN; Fri, 26 Jun 2020 10:04:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39808)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>) id 1jooy4-0004rW-VG
 for bug-guile@HIDDEN; Fri, 26 Jun 2020 10:04:36 -0400
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 <ludo@HIDDEN>) id 1jooy4-0004b6-IV
 for bug-guile@HIDDEN; Fri, 26 Jun 2020 10:04:36 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: bug-guile@HIDDEN
Subject: [3.0.4] Incorrect =?utf-8?B?4oCYZXF2P+KAmQ==?= reduction in
 =?utf-8?Q?64=E2=86=9232-bit?= cross-compilation
X-Debbugs-Cc: "Jan (janneke) Nieuwenhuizen" <janneke@HIDDEN>
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
Date: Fri, 26 Jun 2020 16:04:34 +0200
Message-ID: <87zh8pncst.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
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: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

In <https://issues.guix.gnu.org/42047>, 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 <unnamed function> 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)    ;; #<procedure a4f000 at eqv-reduction-bug.scm:1:0 (i)>
+   3    (make-non-immediate 0 16343)    ;; #<procedure a4f000 at /home/ludo/src/guile-debugging/eqv-reduction-bug.scm:1:?>
    5    (handle-interrupts)             
    6    (return-values)                 
 
 
 Disassembly of <unnamed function> 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.

--=-=-=--




Acknowledgement sent to Ludovic Courtès <ludo@HIDDEN>:
New bug report received and forwarded. Copy sent to janneke@HIDDEN, bug-guile@HIDDEN. Full text available.
Report forwarded to janneke@HIDDEN, bug-guile@HIDDEN:
bug#42060; 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, 26 Jun 2020 16:00:02 UTC

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