Subject: bug#68851: 30.0.50; Native comp: Optimization failure for org-element-property-raw: Handler: org-element-property-raw--inliner

From: Ihor Radchenko <[email-masked]>
Date: Thu, 08 Feb 2024 23:42:53 +0000

Stefan Monnier <[email-masked]> writes:

>> emacs  -Q -batch --eval '(add-to-list '"'"'load-path ".")' --eval
>> '(batch-byte-recompile-directory 0)'
>
> I like to use ` to avoid that quotation gymnastics:
>
>     emacs  -Q -batch --eval '(add-to-list `load-path ".")' ...

Interesting. Thanks for sharing the trick.

>> Looks like it is really not native compiler related.
>> Still, I am puzzled what is going wrong there. The error is
>>
>> Warning: Optimization failure for org-element-property-raw: Handler:
>> org-element-property-raw--inliner
>> (void-function org-element--property-idx)
>>
>> but both org-element--property-idx and org-element-property-raw are
>> inline functions defined in the same file.
>
> `org-element--property-idx` is defined in that same file, indeed, but
> contrary to `defmacro`, `define-inline` does not make the function
> usable during that same file's compilation.

This is surprising. I would not mind compiler indicating this fact in
less cryptic way or, better, making `define-inline' usable during file's
compilation.

Also, I am very confused because the previous version worked:

(define-inline org-element--property-idx (property)
  "Return standard property index or nil."
  (declare (pure t))
  (if (inline-const-p property)
      (plist-get
       org-element--standard-properties-idxs
       (inline-const-val property))
    (inline-quote (plist-get
                   org-element--standard-properties-idxs
                   ,property))))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>