unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Boyer <robertstephenboyer@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69249@debbugs.gnu.org, Andrea Corallo <acorallo@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	rms@gnu.org
Subject: bug#69249: bug in native-compile?
Date: Sun, 18 Feb 2024 14:14:27 -0600	[thread overview]
Message-ID: <CAP9n0TP1HEuSBG1BXVptOr2ZX06E_eTpAxsvnRuPX+FNo397Jg@mail.gmail.com> (raw)
In-Reply-To: <86h6i5r20h.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]

> 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 PM 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
> >
> > ;;   (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 ‘fixnum’ in foo
> > ;; compile-bug.el:2:45: Warning: Unknown defun property ‘vector’ 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 ‘fixnum’ in foo
> > ;; compile-bug.el:12:45: Warning: Unknown defun property ‘vector’ 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?
>


-- 
Anything I seem to state should be taken as a question.  I am at least 77
and feeble.

[-- Attachment #2: Type: text/html, Size: 4022 bytes --]

  reply	other threads:[~2024-02-18 20:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18  4:26 bug#69249: bug in native-compile? Robert Boyer
2024-02-18 19:44 ` Eli Zaretskii
2024-02-18 20:14   ` Robert Boyer [this message]
2024-02-18 21:28     ` Andreas Schwab
2024-02-18 22:19       ` Robert Boyer
2024-02-18 22:25         ` Robert Boyer
2024-02-18 22:39           ` Robert Boyer
2024-02-19  3:30         ` Eli Zaretskii
2024-02-19  3:58           ` Robert Boyer
2024-02-19  7:48   ` Andrea Corallo
2024-02-19 12:49     ` Eli Zaretskii
2024-02-18 22:45 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-18 23:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-18 23:42   ` Robert Boyer
2024-02-18 23:46     ` Robert Boyer
2024-02-19 15:13     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]       ` <CAP9n0TOTEZJy8VXeSyMZpT59u0a434_MiwBA0LrwgjH2xc44ww@mail.gmail.com>
2024-02-20  2:51         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-20  3:42           ` Robert Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP9n0TP1HEuSBG1BXVptOr2ZX06E_eTpAxsvnRuPX+FNo397Jg@mail.gmail.com \
    --to=robertstephenboyer@gmail.com \
    --cc=69249@debbugs.gnu.org \
    --cc=acorallo@gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).