From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Boyer Newsgroups: gmane.emacs.bugs Subject: bug#69249: bug in native-compile? Date: Sun, 18 Feb 2024 14:14:27 -0600 Message-ID: References: <86h6i5r20h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f3c44c0611ada1fc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="661"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69249@debbugs.gnu.org, Andrea Corallo , Stefan Monnier , rms@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 18 21:19:49 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rbndd-000AYK-J2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Feb 2024 21:19:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbndX-0006tr-HV; Sun, 18 Feb 2024 15:19:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbndV-0006ti-S8 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 15:19:41 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbndV-0006XN-KE for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 15:19:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbndq-0007Af-85 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 15:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Boyer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Feb 2024 20:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69249 X-GNU-PR-Package: emacs Original-Received: via spool by 69249-submit@debbugs.gnu.org id=B69249.170828755127469 (code B ref 69249); Sun, 18 Feb 2024 20:20:02 +0000 Original-Received: (at 69249) by debbugs.gnu.org; 18 Feb 2024 20:19:11 +0000 Original-Received: from localhost ([127.0.0.1]:38437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnd0-00078y-BK for submit@debbugs.gnu.org; Sun, 18 Feb 2024 15:19:10 -0500 Original-Received: from mail-lj1-f174.google.com ([209.85.208.174]:54589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnaR-00074H-9q for 69249@debbugs.gnu.org; Sun, 18 Feb 2024 15:16:34 -0500 Original-Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d23d301452so532371fa.1 for <69249@debbugs.gnu.org>; Sun, 18 Feb 2024 12:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708287304; x=1708892104; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rAhokrWnqcbhm9YoqBNvcHS7fk+qwYKg6Zy7J7rwu7s=; b=QJc1ENx9RSukfSxzq2zp4HtZknu2V4BSwiyeiRXkNz3SLAsyV0aM9cMdmsXBn1XQG+ rOfT05L0I+y80tnOrhHBUjWCnguYdjuKlGEmHvciI+N/msxsVvTICTMtSv/mBAn+7+e6 p9/4pbcruWI9EQa9cUGZdxsKg7BtB6twh3ZbSr8XIHX2Aq2HqdGzyK6gw142H/12aK29 cdrmiZBsQl5sE6+hPbe8xYp4u5j51hmHI9QNarF0jFaS3o6jJ/ASH6rJGTtOd/ggnyxh KI0E13ouOKxhOmYu4Ztz/mI7Aws5mstP9g5ShoLXAzTdGkVlyu5Gq8x3ipVwMLT38TOU qJQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708287304; x=1708892104; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rAhokrWnqcbhm9YoqBNvcHS7fk+qwYKg6Zy7J7rwu7s=; b=cwpHLQ4HDc7zeau//qtDmu9p5T2uiMC1wUKZqFvB72uauppHIIGsU0aJbAnOZEZ8FX 6/ehME4U9M3T4cXGOhE7p1QwaE5ZdfL2RBiicnwc8s2wZGSWwehURpSVYfz79RiNgGS/ x2g5nthoE3JE9oiBi3yFpHmrd2VJ72+qOvJ1mAc7CqqEQVFHkk9uksuUhcsGwnWJkpe5 gcYZlHjOq8DAmcJ4g+FPhsXMV5gINZaYLdU9P+ppz0FD0l6a55z7P1OQrJQtVbCOOGqI N0aZlXo4VjNpxgul+pO27hXHmWrTULvG8BbGs20BvLp8vE3F6gXKzsKOXc03E6ZbKTCi 4hDA== X-Forwarded-Encrypted: i=1; AJvYcCXN2Y+dxA4wHkwrkuf5p6wLliF0g9ViV1HZS2abuQsARxB6SpQi2P4WeiazRbTdVFh7/XKSGEccC5cfHKAYj3qrvD1p10M= X-Gm-Message-State: AOJu0Yx1ITqOqVBN165oXkKuq0G2P3XotTO6j+S6x6jj3KlcEgAvEO0g VqlrlyElaYSHWCP7KCidSv1E+0m6Q+3c8osqolPoeQfUJR7WonBy4J52o14CDlvLDwgBRS0N2sb It5dv4NIZPFTEvq2zqm/CZjaV8bQKeOvOtOAzmA== X-Google-Smtp-Source: AGHT+IG8LBj7VelX684QpyzwHtX+qjt+5XZU7w3VLtfHx2WZcT1mCSH8WBgye0Fi2lOlZaNgi1djWvuOZZkQQEuaYcU= X-Received: by 2002:ac2:5e3a:0:b0:512:ab05:cddb with SMTP id o26-20020ac25e3a000000b00512ab05cddbmr1632098lfg.45.1708287304384; Sun, 18 Feb 2024 12:15:04 -0800 (PST) In-Reply-To: <86h6i5r20h.fsf@gnu.org> X-Mailman-Approved-At: Sun, 18 Feb 2024 15:19:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280216 Archived-At: --000000000000f3c44c0611ada1fc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > am I right? Nope. As my message points out, those declare forms are certainly accepted when Emacs interprets them and when byte-compile sees them. Furthermore, such declare forms are necessary for life as we know it in the free world, so that fixnum arithmetic can be used where appropriate! Bob On Sun, Feb 18, 2024 at 1:44=E2=80=AFPM Eli Zaretskii wrote: > > Cc: rms@gnu.org > > From: Robert Boyer > > Date: Sat, 17 Feb 2024 22:26:27 -0600 > > > > Here is a report on what seems to me to be a bug in native-compile. > > > > ---------------------------------------------------------------------- > > > > ;; Let us suppose that this is the file "compile-bug.el" > > > > ;; Invoking (native-compile "compile-bug.el") should work, I do believe= . > > ;; However it fails and the error message is printed below. > > > > ;; It cannot be emphasized enough how serious this problem seems to me, > Bob > > ;; Boyer, robertstephenboyer@gmail.com. > > > > ;; The reason it is so SERIOUS is that ANY Lisp compiler would need to = be > > ;; delighted to see such a typing expression as > > > > ;; (declare (fixnum start end) (vector input scratch)) > > > > ;; Why? BECAUSE it means that the compiler does not have to lay down > code to > > ;; type check the type of start, end, input, and scratch!!!! > > > > ;; However, (native-compile "compile-bug.el") results in the following > error message: > > > > ;; Compiling file > /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/compile-bug.el at Fri Feb > 16 08:25:19 > > 2024 > > ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98fixnum= =E2=80=99 in foo > > ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98vector= =E2=80=99 in foo > > > > (defun foo (start end input scratch) > > (declare (fixnum start end) (vector input scratch)) > > (list start end input scratch)) > > > > ;; foo works fine > > > > ;; Here is an example form for the invocation of foo: > > > > ;; (foo 1 2 (make-vector 3 4) (make-vector 5 6)) > > > > ;; That form runs ok if it is running with foo interpreted. > > > > ;; (byte-compile 'foo) runs ok. > > > > ;; One can run the same form after byte-compiling and it runs ok. > > > > ;; However, (native-compile "compile-bug.el") fails with > > ;; the error report: > > > > ;; Compiling file > /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/compile-bug.el at Fri Feb > 16 08:35:04 > > 2024 > > ;; compile-bug.el:12:45: Warning: Unknown defun property =E2=80=98fixnu= m=E2=80=99 in foo > > ;; compile-bug.el:12:45: Warning: Unknown defun property =E2=80=98vecto= r=E2=80=99 in foo > > Where did you see these declare forms documented? I don't see them in > the ELisp Reference manual. I think you copied them from some other > Lisp. In which case Emacs is correct telling you that these declare > forms are unknown. > > Andrea, Stefan: am I right? > --=20 Anything I seem to state should be taken as a question. I am at least 77 and feeble. --000000000000f3c44c0611ada1fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> am I right?

Nope.
=

As my message points out, those declare forms are certa= inly accepted when Emacs interprets them and when byte-compile=C2=A0sees th= em.=C2=A0 Furthermore, such declare forms are necessary for life as we know= it in the free world, so that fixnum arithmetic can be used where appropri= ate!

Bob

On Sun, Feb 18, 2024 at 1:44=E2=80= =AFPM Eli Zaretskii <eliz@gnu.org>= ; wrote:
> Cc= : rms@gnu.org
> From: Robert Boyer <robertstephenboyer@gmail.com>
> Date: Sat, 17 Feb 2024 22:26:27 -0600
>
> Here is a report on what seems to me to be a bug in native-compile. >
> ----------------------------------------------------------------------=
>
> ;; Let us suppose that this is the file "compile-bug.el"
>
> ;; Invoking (native-compile "compile-bug.el") should work, I= do believe.
> ;; However it fails and the error message is printed below.
>
> ;; It cannot be emphasized enough how serious this problem seems to me= , Bob
> ;; Boyer, robertstephenboyer@gmail.com.
>
> ;; The reason it is so SERIOUS is that ANY Lisp compiler would need to= be
> ;; delighted to see such a typing expression as
>
> ;;=C2=A0 =C2=A0(declare (fixnum start end) (vector input scratch))
>
> ;; Why? BECAUSE it means that the compiler does not have to lay down c= ode to
> ;; type check the type of start, end, input, and scratch!!!!
>
> ;; However, (native-compile "compile-bug.el") results in the= following error message:
>
> ;; Compiling file /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/comp= ile-bug.el at Fri Feb 16 08:25:19
> 2024
> ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98fixnu= m=E2=80=99 in foo
> ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98vecto= r=E2=80=99 in foo
>
> (defun foo (start end input scratch)
>=C2=A0 =C2=A0(declare (fixnum start end) (vector input scratch))
>=C2=A0 =C2=A0(list start end input scratch))
>
> ;; foo works fine
>
> ;; Here is an example form for the invocation of foo:
>
> ;; (foo 1 2 (make-vector 3 4) (make-vector 5 6))
>
> ;; That form runs ok if it is running with foo interpreted.
>
> ;; (byte-compile 'foo) runs ok.
>
> ;; One can run the same form after byte-compiling and it runs ok.
>
> ;; However, (native-compile "compile-bug.el") fails with
> ;; the error report:
>
> ;; Compiling file /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/comp= ile-bug.el at Fri Feb 16 08:35:04
> 2024
> ;; compile-bug.el:12:45: Warning: Unknown defun property =E2=80=98fixn= um=E2=80=99 in foo
> ;; compile-bug.el:12:45: Warning: Unknown defun property =E2=80=98vect= or=E2=80=99 in foo

Where did you see these declare forms documented?=C2=A0 I don't see the= m in
the ELisp Reference manual.=C2=A0 I think you copied them from some other Lisp.=C2=A0 In which case Emacs is correct telling you that these declare forms are unknown.

Andrea, Stefan: am I right?


--
Anything I seem to state should be taken as a question.=C2= =A0 I am at least 77 and feeble.
--000000000000f3c44c0611ada1fc--