GNU bug report logs - #62537
Error compiling emacs master with native compilation activated

Previous Next

Package: emacs;

Reported by: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>

Date: Thu, 30 Mar 2023 07:20:02 UTC

Severity: normal

Merged with 62481, 62596, 62644, 62655

Found in versions 29.0.60, 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62537 in the body.
You can then email your comments to 62537 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 07:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 30 Mar 2023 07:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Error compiling emacs master with native compilation activated
Date: Thu, 30 Mar 2023 09:18:39 +0200
HI
there seems to be a problem when compiling the org-mode files with
native compilation activated

```
  ELC+ELN  org/org-plot.elc

Error: native-ice ("org/org-plot.el" "block does not end with a
branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
#s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
#s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
2) #s(comp-mvar (t) nil nil nil nil 3))) (call
record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
#s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
#s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
nil nil nil nil 3))) (call helper_unbind_n #s(comp-mvar nil nil ((1 .
1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 4)
plist-get) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t)
nil nil nil nil 0)) (setimm #s(comp-mvar (t) nil nil nil nil 6)
:transpose) (set #s(comp-mvar (t) nil nil nil nil 4) (callref funcall
#s(comp-mvar (t) nil nil nil nil 4) #s(comp-mvar (t) nil nil nil nil
5) #s(comp-mvar (t) nil nil nil nil 6))) (set #s(comp-mvar (t) nil nil
nil nil 5) #s(comp-mvar (t) nil nil nil nil 4)) (setimm #s(comp-mvar
(t) nil nil nil nil 6) #s(hash-table size 3 test eq rehash-size 1.5
rehash-threshold 0.8125 purecopy t data (y 105 yes 105 t 105)))) nil
nil nil nil #s(hash-table size 65 test eql rehash-size 1.5
rehash-threshold 0.8125 data ()) nil nil 1 72 nil nil)
org-plot/gnuplot)
  mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode
0x285567f77ae87d2>))
  debug-early-backtrace()
  debug-early(error (native-ice "org/org-plot.el" "block does not end
with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG
83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil
:range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range
nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset
(t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3))) (call record_unwind_protect_excursion) (setimm
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t)
:valset nil :range nil :neg nil :id nil :slot 3) (callref funcall
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
:neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref
funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset
nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)
plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg
nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil
:neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref
funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
:id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg
nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil
:range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 6)
#<hash-table eq 3/3 0x155ea01696a7>)) :closed nil :in-edges nil
:out-edges nil :idom nil :df #<hash-table eql 0/65 0x155ea02c4401>
:post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil
:no-ret nil) org-plot/gnuplot))
  signal(native-ice ("org/org-plot.el" "block does not end with a
branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83")
(call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1
. 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t)
:valset nil :range nil :neg nil :id nil :slot 2) make-temp-file)
(setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil
:range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)
org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)))
(setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3) org-table-to-lisp) (set #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call
helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1))
:neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 4) plist-get) (set #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 5)
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 0)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
:neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar :typeset (t)
:valset nil :range nil :neg nil :id nil :slot 4) (callref funcall
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
:id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil :range
nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil
:range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar :typeset
(t) :valset nil :range nil :neg nil :id nil :slot 6) #<hash-table eq
3/3 0x155ea01696a7>)) :closed nil :in-edges nil :out-edges nil :idom
nil :df #<hash-table eql 0/65 0x155ea02c4401> :post-num nil
:final-frame nil :sp 1 :addr 72 :non-ret-insn nil :no-ret nil)
org-plot/gnuplot))
  comp--native-compile("org/org-plot.el")
  batch-native-compile()
  batch-byte+native-compile()
  command-line-1(("--eval" "(setq load-prefer-newer t
byte-compile-warnings 'all)" "-l" "comp" "-f"
"batch-byte+native-compile" "org/org-plot.el"))
  command-line()
  normal-top-level()
Internal native compiler error: "org/org-plot.el", "block does not end
with a branch", #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
#s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
#s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
2) #s(comp-mvar (t) nil nil nil nil 3))) (call
record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
#s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
#s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
nil nil nil nil 3))) ...) nil nil nil nil #s(hash-table size 65 test
eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil ...),
#<symbol org-plot/gnuplot at 23521>
make[5]: *** [Makefile:327: org/org-plot.elc] Error 255
```

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 08:51:01 GMT) Full text and rfc822 format available.

Message #8 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: 62537 <at> debbugs.gnu.org
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 30 Mar 2023 11:50:20 +0300
merge 62537 62481
thanks

> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Thu, 30 Mar 2023 09:18:39 +0200
> 
> HI
> there seems to be a problem when compiling the org-mode files with
> native compilation activated
> 
> ```
>   ELC+ELN  org/org-plot.elc
> 
> Error: native-ice ("org/org-plot.el" "block does not end with a
> branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
> helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
> #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
> #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
> nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
> 2) #s(comp-mvar (t) nil nil nil nil 3))) (call

This is a duplicate of bug#62481.  We expect this to be solved when
emacs-29 branch is next merged to master.




Merged 62481 62537. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 30 Mar 2023 08:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 09:29:02 GMT) Full text and rfc822 format available.

Message #13 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 62537 <at> debbugs.gnu.org
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 30 Mar 2023 09:28:10 +0000
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> HI
> there seems to be a problem when compiling the org-mode files with
> native compilation activated
>
> ```
>   ELC+ELN  org/org-plot.elc
>
> Error: native-ice ("org/org-plot.el" "block does not end with a
> branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
> helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
> #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
> #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
> nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
> 2) #s(comp-mvar (t) nil nil nil nil 3))) (call
> record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
> nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
> nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
> #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
> #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
> nil nil nil nil 3))) (call helper_unbind_n #s(comp-mvar nil nil ((1 .
> 1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 4)
> plist-get) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t)
> nil nil nil nil 0)) (setimm #s(comp-mvar (t) nil nil nil nil 6)
> :transpose) (set #s(comp-mvar (t) nil nil nil nil 4) (callref funcall
> #s(comp-mvar (t) nil nil nil nil 4) #s(comp-mvar (t) nil nil nil nil
> 5) #s(comp-mvar (t) nil nil nil nil 6))) (set #s(comp-mvar (t) nil nil
> nil nil 5) #s(comp-mvar (t) nil nil nil nil 4)) (setimm #s(comp-mvar
> (t) nil nil nil nil 6) #s(hash-table size 3 test eq rehash-size 1.5
> rehash-threshold 0.8125 purecopy t data (y 105 yes 105 t 105)))) nil
> nil nil nil #s(hash-table size 65 test eql rehash-size 1.5
> rehash-threshold 0.8125 data ()) nil nil 1 72 nil nil)
> org-plot/gnuplot)
>   mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode
> 0x285567f77ae87d2>))
>   debug-early-backtrace()
>   debug-early(error (native-ice "org/org-plot.el" "block does not end
> with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG
> 83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil
> :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
> make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range
> nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset
> (t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 3))) (call record_unwind_protect_excursion) (setimm
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t)
> :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
> :neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref
> funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset
> nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)
> plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg
> nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil
> :neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset
> nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref
> funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
> :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg
> nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil
> :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset
> nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6)
> #<hash-table eq 3/3 0x155ea01696a7>)) :closed nil :in-edges nil
> :out-edges nil :idom nil :df #<hash-table eql 0/65 0x155ea02c4401>
> :post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil
> :no-ret nil) org-plot/gnuplot))
>   signal(native-ice ("org/org-plot.el" "block does not end with a
> branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83")
> (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1
> . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t)
> :valset nil :range nil :neg nil :id nil :slot 2) make-temp-file)
> (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil
> :range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)
> org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t) :valset
> nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)))
> (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 3) org-table-to-lisp) (set #s(comp-mvar :typeset (t) :valset
> nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call
> helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1))
> :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset
> nil :range nil :neg nil :id nil :slot 4) plist-get) (set #s(comp-mvar
> :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5)
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
> :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar :typeset (t)
> :valset nil :range nil :neg nil :id nil :slot 4) (callref funcall
> #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
> :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil :range
> nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil
> :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar :typeset
> (t) :valset nil :range nil :neg nil :id nil :slot 6) #<hash-table eq
> 3/3 0x155ea01696a7>)) :closed nil :in-edges nil :out-edges nil :idom
> nil :df #<hash-table eql 0/65 0x155ea02c4401> :post-num nil
> :final-frame nil :sp 1 :addr 72 :non-ret-insn nil :no-ret nil)
> org-plot/gnuplot))
>   comp--native-compile("org/org-plot.el")
>   batch-native-compile()
>   batch-byte+native-compile()
>   command-line-1(("--eval" "(setq load-prefer-newer t
> byte-compile-warnings 'all)" "-l" "comp" "-f"
> "batch-byte+native-compile" "org/org-plot.el"))
>   command-line()
>   normal-top-level()
> Internal native compiler error: "org/org-plot.el", "block does not end
> with a branch", #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
> helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
> #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
> #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
> nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
> 2) #s(comp-mvar (t) nil nil nil nil 3))) (call
> record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
> nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
> nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
> #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
> #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
> nil nil nil nil 3))) ...) nil nil nil nil #s(hash-table size 65 test
> eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil ...),
> #<symbol org-plot/gnuplot at 23521>
> make[5]: *** [Makefile:327: org/org-plot.elc] Error 255

Hi Pedro,

bisecting this should be due to:
"
52b67740d10df8ca539fdc2c7d50283997683141
Author:     Mattias Engdegård <mattiase <at> acm.org>
AuthorDate: Sat Mar 25 15:38:00 2023 +0100
Commit:     Mattias Engdegård <mattiase <at> acm.org>
CommitDate: Sat Mar 25 16:21:09 2023 +0100

Parent:     db7e95531ac Switch buffer in Ftreesit_query_capture
Merged:     comp-no-spawn
Follows:    emacs-28.2 (164697)

Generalise a LAP optimisation rule

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
rule previously overlooked.  This is usually beneficial in code size
and almost always shortens dynamic paths.
"

I'll try to have a look as soon as I've some time.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 10:01:02 GMT) Full text and rfc822 format available.

Message #16 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 62537 <at> debbugs.gnu.org
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 30 Mar 2023 11:59:52 +0200
Let me know when you are done. I can pull-up a VM in no time to check,
check pre-patches, etc.
I'm on master

Best, /PA

On Thu, 30 Mar 2023 at 11:28, Andrea Corallo <akrl <at> sdf.org> wrote:
>
> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
>
> > HI
> > there seems to be a problem when compiling the org-mode files with
> > native compilation activated
> >
> > ```
> >   ELC+ELN  org/org-plot.elc
> >
> > Error: native-ice ("org/org-plot.el" "block does not end with a
> > branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
> > helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
> > #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
> > #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
> > nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
> > 2) #s(comp-mvar (t) nil nil nil nil 3))) (call
> > record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
> > nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
> > nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
> > #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
> > #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
> > nil nil nil nil 3))) (call helper_unbind_n #s(comp-mvar nil nil ((1 .
> > 1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 4)
> > plist-get) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t)
> > nil nil nil nil 0)) (setimm #s(comp-mvar (t) nil nil nil nil 6)
> > :transpose) (set #s(comp-mvar (t) nil nil nil nil 4) (callref funcall
> > #s(comp-mvar (t) nil nil nil nil 4) #s(comp-mvar (t) nil nil nil nil
> > 5) #s(comp-mvar (t) nil nil nil nil 6))) (set #s(comp-mvar (t) nil nil
> > nil nil 5) #s(comp-mvar (t) nil nil nil nil 4)) (setimm #s(comp-mvar
> > (t) nil nil nil nil 6) #s(hash-table size 3 test eq rehash-size 1.5
> > rehash-threshold 0.8125 purecopy t data (y 105 yes 105 t 105)))) nil
> > nil nil nil #s(hash-table size 65 test eql rehash-size 1.5
> > rehash-threshold 0.8125 data ()) nil nil 1 72 nil nil)
> > org-plot/gnuplot)
> >   mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode
> > 0x285567f77ae87d2>))
> >   debug-early-backtrace()
> >   debug-early(error (native-ice "org/org-plot.el" "block does not end
> > with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG
> > 83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil
> > :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
> > make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range
> > nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset
> > (t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 3))) (call record_unwind_protect_excursion) (setimm
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t)
> > :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
> > :neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref
> > funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset
> > nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)
> > plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg
> > nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil
> > :neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset
> > nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref
> > funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
> > :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg
> > nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil
> > :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset
> > nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6)
> > #<hash-table eq 3/3 0x155ea01696a7>)) :closed nil :in-edges nil
> > :out-edges nil :idom nil :df #<hash-table eql 0/65 0x155ea02c4401>
> > :post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil
> > :no-ret nil) org-plot/gnuplot))
> >   signal(native-ice ("org/org-plot.el" "block does not end with a
> > branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83")
> > (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1
> > . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t)
> > :valset nil :range nil :neg nil :id nil :slot 2) make-temp-file)
> > (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil
> > :range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)
> > org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t) :valset
> > nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3)))
> > (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 3) org-table-to-lisp) (set #s(comp-mvar :typeset (t) :valset
> > nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call
> > helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1))
> > :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset
> > nil :range nil :neg nil :id nil :slot 4) plist-get) (set #s(comp-mvar
> > :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5)
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
> > :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar :typeset (t)
> > :valset nil :range nil :neg nil :id nil :slot 4) (callref funcall
> > #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
> > :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
> > nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
> > :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil :range
> > nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil
> > :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar :typeset
> > (t) :valset nil :range nil :neg nil :id nil :slot 6) #<hash-table eq
> > 3/3 0x155ea01696a7>)) :closed nil :in-edges nil :out-edges nil :idom
> > nil :df #<hash-table eql 0/65 0x155ea02c4401> :post-num nil
> > :final-frame nil :sp 1 :addr 72 :non-ret-insn nil :no-ret nil)
> > org-plot/gnuplot))
> >   comp--native-compile("org/org-plot.el")
> >   batch-native-compile()
> >   batch-byte+native-compile()
> >   command-line-1(("--eval" "(setq load-prefer-newer t
> > byte-compile-warnings 'all)" "-l" "comp" "-f"
> > "batch-byte+native-compile" "org/org-plot.el"))
> >   command-line()
> >   normal-top-level()
> > Internal native compiler error: "org/org-plot.el", "block does not end
> > with a branch", #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
> > helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
> > #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
> > #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
> > nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
> > 2) #s(comp-mvar (t) nil nil nil nil 3))) (call
> > record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
> > nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
> > nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
> > #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
> > #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
> > nil nil nil nil 3))) ...) nil nil nil nil #s(hash-table size 65 test
> > eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil ...),
> > #<symbol org-plot/gnuplot at 23521>
> > make[5]: *** [Makefile:327: org/org-plot.elc] Error 255
>
> Hi Pedro,
>
> bisecting this should be due to:
> "
> 52b67740d10df8ca539fdc2c7d50283997683141
> Author:     Mattias Engdegård <mattiase <at> acm.org>
> AuthorDate: Sat Mar 25 15:38:00 2023 +0100
> Commit:     Mattias Engdegård <mattiase <at> acm.org>
> CommitDate: Sat Mar 25 16:21:09 2023 +0100
>
> Parent:     db7e95531ac Switch buffer in Ftreesit_query_capture
> Merged:     comp-no-spawn
> Follows:    emacs-28.2 (164697)
>
> Generalise a LAP optimisation rule
>
> * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
> Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
> rule previously overlooked.  This is usually beneficial in code size
> and almost always shortens dynamic paths.
> "
>
> I'll try to have a look as soon as I've some time.
>
> Thanks
>
>   Andrea



-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 10:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 62537 <at> debbugs.gnu.org, Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 30 Mar 2023 12:37:15 +0200
30 mars 2023 kl. 11.28 skrev Andrea Corallo <akrl <at> sdf.org>:

> bisecting this should be due to:
> "
> 52b67740d10df8ca539fdc2c7d50283997683141

> Generalise a LAP optimisation rule

That change should be entirely safe. Perhaps it just somehow triggers an unexpected path in nativecomp?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 30 Mar 2023 13:36:02 GMT) Full text and rfc822 format available.

Message #22 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 62537 <at> debbugs.gnu.org, Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 30 Mar 2023 13:35:27 +0000
Mattias Engdegård <mattiase <at> acm.org> writes:

> 30 mars 2023 kl. 11.28 skrev Andrea Corallo <akrl <at> sdf.org>:
>
>> bisecting this should be due to:
>> "
>> 52b67740d10df8ca539fdc2c7d50283997683141
>
>> Generalise a LAP optimisation rule
>
> That change should be entirely safe. Perhaps it just somehow triggers an unexpected path in nativecomp?

That's entirely possible :)

Will look at and report.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Fri, 31 Mar 2023 10:27:01 GMT) Full text and rfc822 format available.

Message #25 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 62537 <at> debbugs.gnu.org, Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Fri, 31 Mar 2023 10:26:20 +0000
Andrea Corallo <akrl <at> sdf.org> writes:

> Mattias Engdegård <mattiase <at> acm.org> writes:
>
>> 30 mars 2023 kl. 11.28 skrev Andrea Corallo <akrl <at> sdf.org>:
>>
>>> bisecting this should be due to:
>>> "
>>> 52b67740d10df8ca539fdc2c7d50283997683141
>>
>>> Generalise a LAP optimisation rule
>>
>> That change should be entirely safe. Perhaps it just somehow triggers an unexpected path in nativecomp?
>
> That's entirely possible :)
>
> Will look at and report.
>
>   Andrea

I haven't had time to complete the investigation/fix but as data
point...

This is the most reduced reproducer I could produce:

;;; -*- lexical-binding: t; -*-
(defun test ()
  (when (let
            ((val
              (foo)))
          (cond
           ((eq val 'x)
            t)
           ((eq val 'y)
            'y)))
    (foo))
  t)

This is the old LAP:

(byte-constant foo . 0)
(byte-call . 0)
(byte-dup)
(byte-constant #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (x 8 y 12)) . 1)
(byte-switch)
(byte-goto TAG 16 . 1)
(TAG 8 . 1)
(byte-constant t . 2)
(byte-goto TAG 17 . 2)
(TAG 12 . 1)
(byte-constant t . 2)
(byte-goto TAG 17 . 2)
(TAG 16 . 1)
(byte-constant nil . 3)
(TAG 17 . 2)
(byte-stack-set . 1)
(byte-goto-if-nil TAG 25 . 0)
(byte-constant foo . 0)
(byte-call . 0)
(byte-discard)
(TAG 25 . 0)
(byte-constant t . 2)
(byte-return . 0)

This is the new one:

(byte-constant foo . 0)
(byte-call . 0)
(byte-dup)
(byte-constant #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (x 9 y 9)) . 1)
(byte-switch)
(byte-discard)
(byte-goto TAG 13 . 0)
(TAG 9 . 1)
(byte-discard)
(byte-constant foo . 0)
(byte-call . 0)
(byte-discard)
(TAG 13 . 0)
(byte-constant t . 2)
(byte-return . 0)

At a very quick look I don't see anything wrong with it so as
anticipated most lickly is just a bug in the native compiler limplify
pass.

Best Regards

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Fri, 31 Mar 2023 15:16:02 GMT) Full text and rfc822 format available.

Message #28 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 62537 <at> debbugs.gnu.org, Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Fri, 31 Mar 2023 17:14:58 +0200
31 mars 2023 kl. 12.26 skrev Andrea Corallo <akrl <at> sdf.org>:

> At a very quick look I don't see anything wrong with it so as
> anticipated most lickly is just a bug in the native compiler limplify
> pass.

I agree, the output looks correct. Good example by the way, and it illustrates the motivation behind the change well -- the new code is much better, although it can still be improved.
Let us know what you find.





Merged 62481 62537 62596. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 01 Apr 2023 18:57:02 GMT) Full text and rfc822 format available.

Merged 62481 62537 62596 62644. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 03 Apr 2023 14:37:02 GMT) Full text and rfc822 format available.

Merged 62481 62537 62596 62644 62655. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 04 Apr 2023 02:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Wed, 05 Apr 2023 17:21:02 GMT) Full text and rfc822 format available.

Message #37 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: 62537 <at> debbugs.gnu.org
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Eli Zaretskii <eliz <at> gnu.org>,
 Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Wed, 05 Apr 2023 17:19:57 +0000
Gut I finally have a fix for this!

As we suspected was a bug in the native compiler limplification pass
triggered by the new LAP emitted.

fa669c4b17c fixes bootstrap --with-native-compilation=aot here and adds
a test, is now pushed to master.  In 29 the bug never showed up
(probably because the new LAP tweak is not it) so I guess it's better to
leave the code as it is.

Now we should finally have again bootstrap for both master and 29 clean,
so any issue we might see is unexpected to me.

Best Regards

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Wed, 05 Apr 2023 20:52:01 GMT) Full text and rfc822 format available.

Message #40 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62537 <at> debbugs.gnu.org,
 Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Wed, 5 Apr 2023 22:51:01 +0200
5 apr. 2023 kl. 19.19 skrev Andrea Corallo <akrl <at> sdf.org>:

> As we suspected was a bug in the native compiler limplification pass
> triggered by the new LAP emitted.
> 
> fa669c4b17c fixes bootstrap --with-native-compilation=aot here and adds
> a test, is now pushed to master.  In 29 the bug never showed up
> (probably because the new LAP tweak is not it) so I guess it's better to
> leave the code as it is.

Nice! So the bug was that we optimised away switches where all jump targets are the same, without considering the fall-through case?

(Perhaps we should do something like that in the LAP optimiser. Wonder how common the opportunity is though.)

By the way, the bulk of `comp-jump-table-optimizable` should be equivalent to something like

   (apply #'= (hash-table-values jmp-table))

which is arguably clearer and definitely shorter.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Wed, 05 Apr 2023 21:13:01 GMT) Full text and rfc822 format available.

Message #43 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62537 <at> debbugs.gnu.org,
 Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Wed, 05 Apr 2023 21:12:09 +0000
Mattias Engdegård <mattiase <at> acm.org> writes:

> 5 apr. 2023 kl. 19.19 skrev Andrea Corallo <akrl <at> sdf.org>:
>
>> As we suspected was a bug in the native compiler limplification pass
>> triggered by the new LAP emitted.
>> 
>> fa669c4b17c fixes bootstrap --with-native-compilation=aot here and adds
>> a test, is now pushed to master.  In 29 the bug never showed up
>> (probably because the new LAP tweak is not it) so I guess it's better to
>> leave the code as it is.
>
> Nice! So the bug was that we optimised away switches where all jump targets are the same, without considering the fall-through case?

Hi Mattias,
yep that's correct :)

> (Perhaps we should do something like that in the LAP optimiser. Wonder how common the opportunity is though.)

Yeah might be a good idea even if I don't know how common this condition
is.  (We might count how many times `comp-jump-table-optimizable' returns
t in an aot build tho to get an idea).

> By the way, the bulk of `comp-jump-table-optimizable` should be equivalent to something like
>
>    (apply #'= (hash-table-values jmp-table))
>
> which is arguably clearer and definitely shorter.

True but with the downside that it conses.  I'll think about if I want
to change it, thanks for the neat suggestion tho :)

Best Regards

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Wed, 05 Apr 2023 21:47:01 GMT) Full text and rfc822 format available.

Message #46 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62537 <at> debbugs.gnu.org,
 Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Wed, 5 Apr 2023 23:46:09 +0200
5 apr. 2023 kl. 23.12 skrev Andrea Corallo <akrl <at> sdf.org>:

>> (Perhaps we should do something like that in the LAP optimiser. Wonder how common the opportunity is though.)
> 
> Yeah might be a good idea even if I don't know how common this condition
> is.

Experimentally adding a LAP optimiser rule for it resulted in no matches during a complete lisp recompilation, so it's safe to say that it's not very common. 

I'm not going to bother, but perhaps your code works on something that has undergone further transformations and is thus more likely to trigger the rule?

>>   (apply #'= (hash-table-values jmp-table))
>> 
>> which is arguably clearer and definitely shorter.
> 
> True but with the downside that it conses.

More than the current code?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62537; Package emacs. (Thu, 06 Apr 2023 10:43:02 GMT) Full text and rfc822 format available.

Message #49 received at 62537 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62537 <at> debbugs.gnu.org,
 Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Subject: Re: bug#62537: Error compiling emacs master with native compilation
 activated
Date: Thu, 6 Apr 2023 12:42:18 +0200
5 apr. 2023 kl. 19.19 skrev Andrea Corallo <akrl <at> sdf.org>:

> In 29 the bug never showed up
> (probably because the new LAP tweak is not it) so I guess it's better to
> leave the code as it is.

Actually I don't think I can prove that the LAP code will never have the pattern that triggered the bug in Emacs 29; nothing prevents it in principle from occurring anyway.

It doesn't seem safe to keep the buggy limplification in that branch -- I suggest we remove the switch-eliminating optimisation in comp.el altogether just in case. What do you think?





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Oct 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 185 days ago.

Previous Next


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