From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Help with the disassembly of a very short function, please. Date: Sat, 1 Jan 2022 19:01:03 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17832"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 01 20:02:07 2022 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 1n3jdn-0004Tp-6v for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 20:02:07 +0100 Original-Received: from localhost ([::1]:45770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3jdl-0000ff-RW for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 14:02:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3jcr-00084v-Fg for emacs-devel@gnu.org; Sat, 01 Jan 2022 14:01:09 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:64227 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1n3jco-0005lB-Cr for emacs-devel@gnu.org; Sat, 01 Jan 2022 14:01:08 -0500 Original-Received: (qmail 30350 invoked by uid 3782); 1 Jan 2022 19:01:04 -0000 Original-Received: from acm.muc.de (p2e5d5389.dip0.t-ipconnect.de [46.93.83.137]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 01 Jan 2022 20:01:03 +0100 Original-Received: (qmail 16079 invoked by uid 1000); 1 Jan 2022 19:01:03 -0000 Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:283812 Archived-At: Hello, Emacs. The following function comes from .../test/src/comp-tests.el, more or less: ;; -*- lexical-binding: t -*- (defun comp-test-55 (x) (unless (integerp x) x)) I byte compile it with C-x C-e then dump out its byte code with M-x disassemble. I get this: byte code for comp-test-55: doc: ... args: (arg1) 0 dup 1 integerp 2 not 3 goto-if-nil-else-pop 1 6 dup 7:1 return .. In the case where x is not an integer, it seems that the dup at 6 will leave two many copies of x on the stack for the return. In the case where x is an integer, it seems that the goto-if-nil-else-pop will leave a nil on the stack over the original x, returning the nil but leaving a superfluous copy of the integer x on the stack. So, either way, there is an unwanted copy of x left on the stack at the end of the function. I can't work this out. What am I missing? -- Alan Mackenzie (Nuremberg, Germany).