From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68851: 30.0.50; Native comp: Optimization failure for org-element-property-raw: Handler: org-element-property-raw--inliner Date: Thu, 08 Feb 2024 18:30:45 -0500 Message-ID: References: <87zfwl8vd9.fsf@localhost> <86zfwl1t5y.fsf@gnu.org> <87sf2bxa3k.fsf@localhost> <877cjeyd77.fsf@localhost> <874jeiy68l.fsf@localhost> <87a5oavc3e.fsf@localhost> <877cjev9mb.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30573"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Andrea Corallo , 68851@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 09 01:27:17 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 1rYEjd-0007ml-I6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Feb 2024 01:27:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYEjP-0003bx-5q; Thu, 08 Feb 2024 19:27:03 -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 1rYEjA-0003ZE-8e for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 19:26:50 -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 1rYEj9-0002sQ-IN for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 19:26:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYEjO-0005Ff-6a for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 19:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Feb 2024 00:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68851 X-GNU-PR-Package: emacs Original-Received: via spool by 68851-submit@debbugs.gnu.org id=B68851.170743837220025 (code B ref 68851); Fri, 09 Feb 2024 00:27:02 +0000 Original-Received: (at 68851) by debbugs.gnu.org; 9 Feb 2024 00:26:12 +0000 Original-Received: from localhost ([127.0.0.1]:42765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYEiZ-0005Cr-Ft for submit@debbugs.gnu.org; Thu, 08 Feb 2024 19:26:11 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYEiW-0005CJ-PJ for 68851@debbugs.gnu.org; Thu, 08 Feb 2024 19:26:09 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A6988442C46; Thu, 8 Feb 2024 18:30:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1707435046; bh=3PiRFhge/8cM2vh1DVW2Rk3Z/38LN2+fhv0kGM+6Puk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jysvdnnQCbzo56Ttiox5zF0hBuZT1Kya6wg1xVPbrtDBHPZvSrIYIu224MImokLH8 Skp3yyC00HMI3Y2pY37nxeN5lM/ToxuiA39ug2WmNm+rnrJ/B4D0RBNCCanqvSHviN X4pv4dk6gPTh2WnsZND9njC3M9z+Yv1alk2BBsHDOxzqs6djdeyG+H1wBteZ9NiqMH xcSaFxf347QXkjArXEjH16qio6gijzKiEZ3Gk/pa60s6ZzN0zKzl4yp357PUhJuGBg QkHKqv54S+FAPkNrW4Ae3owqxEfEEgaIzryADfnvSr68p/lxK08SaYDidZoDuZgw/N fnS9rxnsiHzow== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1053C442C39; Thu, 8 Feb 2024 18:30:46 -0500 (EST) Original-Received: from pastel (unknown [104.247.238.113]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DAB2D1204DA; Thu, 8 Feb 2024 18:30:45 -0500 (EST) In-Reply-To: <877cjev9mb.fsf@localhost> (Ihor Radchenko's message of "Thu, 08 Feb 2024 23:06:52 +0000") 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:279670 Archived-At: Ihor Radchenko [2024-02-08 23:06:52] wrote: > Andrea Corallo writes: > >>> cd org-mode/lisp >>> emacs -Q -batch --eval '(add-to-list '"'"'load-path ".")' --eval >>> '(batch-native-compile)' org-element-ast.el >> >> Negative, I've already the invocation for the native compilation, what I >> want is the one for byte compilation. >> >> Reason for that is that my crystal ball suggests compilers are invoked >> in different ways. Actually >> >> emacs -Q -batch --eval '(add-to-list '"'"'load-path ".")' --eval >> '(batch-byte-compile)' org-element-ast.el >> >> gives here the same exact error the native compiler gives. > > I confirm. > >> That BTW is in disagreement with: >> >>>> Ihor have you tried compiling the compilation unit from command line >>>> (using batch-byte-compile or batch-native-compile)? If some dependency >>>> is broken this should highlight it. >>> >>> batch-byte-compile does not emit any warnings. >>> batch-native-compile emits the same warning: > > Hmm. I think what I tried was a bit different. I did make compile, which > is using batch-byte-recompile-directory: > > 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 ".")' ... > 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. IOW, you can work around that problem with `eval-and-compile`, for example. Stefan diff --git a/lisp/org-element-ast.el b/lisp/org-element-ast.el index b624fd1c87..0079334bca 100644 --- a/lisp/org-element-ast.el +++ b/lisp/org-element-ast.el @@ -350,13 +350,14 @@ node types.") plist) "Property list holding standard indexes for `org-element--standard-properties'.")) -(define-inline org-element--property-idx (property) +(eval-and-compile + (define-inline org-element--property-idx (property) "Return standard property index or nil." (declare (pure t)) (inline-letevals (property) (plist-get org-element--standard-properties-idxs - (inline-const-val property)))) + (inline-const-val property))))) (define-inline org-element--parray (node) "Return standard property array for NODE."