GNU bug report logs -
#69249
bug in native-compile?
Previous Next
Full log
Message #44 received at 69249 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Cc: rms <at> gnu.org
>> From: Robert Boyer <robertstephenboyer <at> 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 <at> 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?
Hi Eli,
yes you are correct, we don't support this (so far at least).
Andrea
This bug report was last modified 81 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.