From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.bugs Subject: bug#13741: guile-2.0: optimize, and eq-ness of literals (test-suite) Date: Mon, 18 Feb 2013 11:27:39 +0800 Message-ID: <87621q8fo4.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1361158093 29893 80.91.229.3 (18 Feb 2013 03:28:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Feb 2013 03:28:13 +0000 (UTC) To: 13741@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Feb 18 04:28:35 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U7HP9-00073Q-5g for guile-bugs@m.gmane.org; Mon, 18 Feb 2013 04:28:35 +0100 Original-Received: from localhost ([::1]:46751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOm-0001Bh-TZ for guile-bugs@m.gmane.org; Sun, 17 Feb 2013 22:28:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOi-0001Aa-0Y for bug-guile@gnu.org; Sun, 17 Feb 2013 22:28:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7HOf-0007b8-RG for bug-guile@gnu.org; Sun, 17 Feb 2013 22:28:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOf-0007b4-7v for bug-guile@gnu.org; Sun, 17 Feb 2013 22:28:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U7HPa-0001qS-3z for bug-guile@gnu.org; Sun, 17 Feb 2013 22:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Hartwig Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 18 Feb 2013 03:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13741 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13611581387081 (code B ref -1); Mon, 18 Feb 2013 03:29:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2013 03:28:58 +0000 Original-Received: from localhost ([127.0.0.1]:33553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7HPV-0001q9-81 for submit@debbugs.gnu.org; Sun, 17 Feb 2013 22:28:58 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59392) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7HPT-0001q2-9B for submit@debbugs.gnu.org; Sun, 17 Feb 2013 22:28:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7HOX-0007aa-4E for submit@debbugs.gnu.org; Sun, 17 Feb 2013 22:27:58 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:56327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOX-0007aW-0V for submit@debbugs.gnu.org; Sun, 17 Feb 2013 22:27:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOW-00019f-1z for bug-guile@gnu.org; Sun, 17 Feb 2013 22:27:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7HOU-0007aD-Ma for bug-guile@gnu.org; Sun, 17 Feb 2013 22:27:55 -0500 Original-Received: from mail-da0-f43.google.com ([209.85.210.43]:33036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7HOU-0007a9-Fq for bug-guile@gnu.org; Sun, 17 Feb 2013 22:27:54 -0500 Original-Received: by mail-da0-f43.google.com with SMTP id u36so2268477dak.30 for ; Sun, 17 Feb 2013 19:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=nZLGaLwx1dgMfyfs7oiEvRQ0abOSeMPYaH3rnBMR3NI=; b=NOAWTFWASjea5BV6B1mv/R1fnPVau8SeGJzWIB4LwLOuTYNsupleUVtQo3I+5AIVXo Ji4wVnhc5zE0T5/8HN2AR7F/USbGspxNvpM66QL9UmxnPjr76X17kRxJxIOqvXD0c67A oXQjYU/nQ8d02j604LTO2FlUkiSHo6cYh1LECTcKYpAAy70Hp4uVFE8xGO8AmY5bajYP pYq5chW+c2l1IqNdIIzewSfXScqgsky30ipFK4GGLHodE1uFZEW+2Ba5crFgzJD9OhC2 aZIbT5yDdQlX+p+8oAr2n6QMABisEltwfipdfuFzKgcdhSbT8VzUAZxrYBM8O/sUjimy WCxg== X-Received: by 10.66.81.166 with SMTP id b6mr32306162pay.7.1361158073747; Sun, 17 Feb 2013 19:27:53 -0800 (PST) Original-Received: from io ([101.119.31.83]) by mx.google.com with ESMTPS id w2sm96750924pax.22.2013.02.17.19.27.51 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sun, 17 Feb 2013 19:27:53 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6743 Archived-At: Version: 2.0.7 # stable-2.0, around commit: 3d2b267 # ./configure (no arguments) hash.test has a failing case: FAIL: tests/hash.test: hash-set and hash-ref: ;; 1/2 and 2/4 are equal? and eqv? but not eq? (pass-if (equal? #f (let ((table (make-hash-table))) (hashq-set! table 1/2 (quote foo)) (hashq-ref table 1/2)))) which may be due to the optimizer or other component working on literals: scheme@(guile-user)> (eqv? 1/2 2/4) $1 =3D #t scheme@(guile-user)> (eq? 1/2 2/4) $2 =3D #f scheme@(guile-user)> ,optimize (eq? 1/2 2/4) $3 =3D #f scheme@(guile-user)> (hashq 1/2 31) $4 =3D 6 scheme@(guile-user)> (hashq 2/4 31) $5 =3D 20 scheme@(guile-user)> ,optimize (hashq 2/4 31) $6 =3D (hashq 1/2 31) scheme@(guile-user)> ;; uh oh The ramifications reach beyond hash functions: scheme@(guile-user)> (define x 1/2) scheme@(guile-user)> (eq? x 2/4) $7 =3D #f scheme@(guile-user)> ,optimize (eq? x 2/4) $8 =3D (eq? x 1/2) scheme@(guile-user)> (define y 2/4) scheme@(guile-user)> (eq? x y) $9 =3D #f scheme@(guile-user)> ,optimize (define y 2/4) $10 =3D (define y 1/2) I recall some discussion where it was made clear that literals can not be assumed eq?, and that *at least* eqv? should be used to compare numeric values unless they are known to be the same value (i.e. =E2=80=98(d= efine y x) (eq? x y)=E2=80=99). Is that right? This particular test and some others properly should fade away then, or at least drop the eq-case.