From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs is not reproducible Date: Wed, 26 May 2021 16:58:24 -0400 Message-ID: References: <87lf8dcrcd.fsf@disroot.org> <15pmxh100n.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34465"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Glenn Morris , Mattias =?windows-1252?Q?Engdeg=E5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 26 23:00:08 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lm0dM-0008no-E4 for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 23:00:08 +0200 Original-Received: from localhost ([::1]:53596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm0dL-0007pp-Cn for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 17:00:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm0bo-0006PW-9u for emacs-devel@gnu.org; Wed, 26 May 2021 16:58:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm0bl-0004YI-TS; Wed, 26 May 2021 16:58:31 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 62D854414D0; Wed, 26 May 2021 16:58:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B06F1441075; Wed, 26 May 2021 16:58:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622062705; bh=eMPRX8MM+AWkyO9xEibRi1SN/qd0nETTdStWLuy3gKs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=pZMuBNR60VGcrROFZ82fm/ZLqSFzYZ5k8ltqujJSwRTT1dEQ14KZ2/rDNIOo7qT3n SWGnuGo7QHdpUzydZ5bTtB4zk2tKAhiSVqQb9MQwKcIxRv+B67sNNU+GXtktoON2L4 TJvJCcWIUeevJCSif7UaM9Fqet8ufF4ILC+5OTc0YXcwaBS0+49T6F6/Q2xSsMuEtT oz1Ek65WXBFhUy4rq3j69DwfMKgQTwP3jh6hprVYEVNM4sRqRO4wh8/gQJ5OCp/MT7 8cVRe9tCYwnCqI4euF8rXueegeAvxw3QPPH5wpPdWk93T+MsKQZdxKREHzISwxBuGp 14bvs18te4U3w== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7F403120AAB; Wed, 26 May 2021 16:58:25 -0400 (EDT) In-Reply-To: (Glenn Morris's message of "Tue, 25 May 2021 14:03:52 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269928 Archived-At: Glenn Morris [2021-05-25 14:03:52] wrote: >>> It causes all tests in test/lisp/cedet/semantic-utest-ia.el to fail. > FTR, I should have said "four", not "all". OK, I think I found the culprit! When `byte-compile-inline-expand` calls `byte-compile`, the nested compilation may end up using the outer value of `byte-optimize--lexvars` resulting in plain-old broken code. In the case at hand, during compilation of `semantic-analyze-find-tag-sequence-default` the call to `semantic-tag-of-class-p` gets miscompiled because `byte-optimize--lexvars` says that `tag` is known to be nil and that info gets propagated to the body of `semantic-tag-of-class-p` (where `tag` refers to another variable). Matthias, could you try and see where byte-opt.el should let-bind `byte-optimize--lexvars` to nil to avoid this problem? I guess we could add it to `byte-compile-top-level`, but it would be better if we could do it somewhere in `byte-opt.el`. See sample session below for "the evidence". Stefan % rm lisp/cedet/semantic/analyze.elc lisp/cedet/semantic/tag.elc; make -C l= isp cedet/semantic/analyze.elc make=A0: on entre dans le r=E9pertoire =AB=A0/home/monnier/src/emacs/trunk/= lisp=A0=BB ELC cedet/semantic/analyze.elc Byte-compiling for inlinling: semantic-tag-p Byte-compiling for inlinling: semantic-tag-class Source =3D (closure (t) (tag) "Return the class of TAG. This is a symbol like `variable', `function', or `type'. There is no limit to the symbols that may represent the class of a tag. Each parser generates tags with classes defined by it. For functional languages, typical tag classes are: @table @code @item type Data types, named map for a memory block. @item function A function or method, or named execution location. @item variable A variable, or named storage for data. @item include Statement that represents a file from which more tags can be found. @item package Statement that declares this file's package name. @item code Code that has not name or binding to any other symbol, such as in a script. @end table " (nth 1 tag)) Byte-code =3D #[257 "\211A@\207" [] 2 "Return the class of TAG. This is a symbol like `variable', `function', or `type'. There is no limit to the symbols that may represent the class of a tag. Each parser generates tags with classes defined by it. For functional languages, typical tag classes are: @table @code @item type Data types, named map for a memory block. @item function A function or method, or named execution location. @item variable A variable, or named storage for data. @item include Statement that represents a file from which more tags can be found. @item package Statement that declares this file's package name. @item code Code that has not name or binding to any other symbol, such as in a script. @end table (fn TAG)"] lexvars =3D nil Disass: byte code: doc: Return the class of TAG. ... args: (arg1) 0 dup=20=20=20=20=20=20=20 1 cdr=20=20=20=20=20=20=20 2 car=20=20=20=20=20=20=20 3 return=20=20=20=20 Byte-compiling for inlinling: semantic-tag-type Byte-compiling for inlinling: semantic-tag-get-attribute Byte-compiling for inlinling: semantic-tag-attributes Byte-compiling for inlinling: semantic-tag-of-class-p Source =3D (closure (t) (tag class) "Return non-nil if class of TAG is CLAS= S." (eq (semantic-tag-class tag) class)) Byte-code =3D #[514 "\211A@\262=3D\207" [] 4 "Return non-nil if class of TA= G is CLASS. (fn TAG CLASS)"] lexvars =3D ((tagclass nil) (miniscope nil) (fname nil nil) (tagtype nil ni= l) (tag nil nil) (tmp t) (s nil)) Disass: byte code: doc: Return non-nil if class of TAG is CLASS. ... args: (arg1 arg2) 0 stack-ref 1 1 dup=20=20=20=20=20=20=20 2 cdr=20=20=20=20=20=20=20 3 car=20=20=20=20=20=20=20 4 stack-set 1 6 stack-ref 1 7 eq=20=20=20=20=20=20=20=20 8 return=20=20=20=20 Byte-compiling for inlinling: semantic-tag-name Byte-compiling for inlinling: semantic-tag Byte-compiling for inlinling: semantic-tag-type-members Byte-compiling for inlinling: semantic-tag-function-arguments