From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#71555: 29.3.50; Native-compilation sets some variable to nil unexpectedly. Date: Sun, 16 Jun 2024 14:46:07 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20636"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71555@debbugs.gnu.org, Andrea Corallo To: =?UTF-8?Q?S=C3=A9v=C3=A8re?= Durand Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 16 14:48:18 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 1sIpIw-0005Dh-1C for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jun 2024 14:48:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIpIj-0000vG-H2; Sun, 16 Jun 2024 08:48:05 -0400 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 1sIpIh-0000pF-2q for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 08:48:03 -0400 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 1sIpIf-0002Cl-Cg for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 08:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIpIg-0007eo-Dy for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 08:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jun 2024 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71555 X-GNU-PR-Package: emacs Original-Received: via spool by 71555-submit@debbugs.gnu.org id=B71555.171854204029321 (code B ref 71555); Sun, 16 Jun 2024 12:48:02 +0000 Original-Received: (at 71555) by debbugs.gnu.org; 16 Jun 2024 12:47:20 +0000 Original-Received: from localhost ([127.0.0.1]:53672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIpHz-0007cn-9t for submit@debbugs.gnu.org; Sun, 16 Jun 2024 08:47:19 -0400 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:55773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIpHx-0007cR-7T for 71555@debbugs.gnu.org; Sun, 16 Jun 2024 08:47:17 -0400 Original-Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57cce3bc8c6so1146134a12.3 for <71555@debbugs.gnu.org>; Sun, 16 Jun 2024 05:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718541970; x=1719146770; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hpDdxvaUxHFSD9866hWhWjWv7QVfP5LXhVeWubKatWg=; b=mEc7DizXAZDr6DVYEUOh1zpeTMh8OKEHJwoBi2+0mSqu+7Fvp8cMJjCEKTYi+7dLkH bbSaO36bYoF8DDO1jf44l/We/C7jY7ORdH2TSgMXVQjZGA/ONWcgNljEG6TGAtfj+BwG uCKiF61ZE6dn0tONOKI1V2mqkTdqPVqpHcacSdsiFspxRqmttZH1mTuyMQUT5Ms+OY2j Ip2yivHluGiTfQ3BEt+9i8dSLi4Rbr7xpAkcbSPDwkM/KLxFrMnUaCfkwoClHCZ37SwJ sV7TiN3LukIVkvgcCXTSzmZGGu0UFoij3OqUEgNROouHrbra9j3lb5PiniPzqtDxDpaq 2IkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718541970; x=1719146770; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hpDdxvaUxHFSD9866hWhWjWv7QVfP5LXhVeWubKatWg=; b=AhFH2a2qqObxpvzXzl3LVeoP5BaQ5aNVwFpl23xCnOSrAEDKtGOVPiAJvUnCVNVWJi WbIU4wOWjVEgKtwl68BD81NJcY/fG8Bm2s8Ohzs+Vym/XFyogQTRH7E+ZA2sZT4/tv89 Qa2IRsAWuz2q6hRvfTUSCX952Y0Qo9VlHPmhKmciJIX9A07VesAl0ZXu5En3WvGvbwaZ Eq4SNYyLsvPFNE/YSO/j5CCRhQwoypij8Dfat+FX+t5mfYVXv1M6tt85QgzRvxb/Sg43 p2QzvQzgSV9/pydNbDPAlPN9r8Z2HiRLOyA7MCXWBNYsZma84lryQJhqesKxUXcfaA7M Sv6Q== X-Gm-Message-State: AOJu0Yweul5rsrL/CWWFyJ4DSkRXZvCrWTE/pnWzggwrbpR2dY5bk0BI GW0X/zSyPurDnLw1wotKHDPuzpjwZPs6t5quVHxpZli0DF2BMCWBl/bUHA== X-Google-Smtp-Source: AGHT+IHE4iygz5Q1QqYtNQxDgYh0IxJ4Br5whKG+fTpVOXmBTanDaPa4dOiXJAtry4572EN+tj9dzQ== X-Received: by 2002:a50:cd97:0:b0:575:954:7ef with SMTP id 4fb4d7f45d1cf-57cbd697059mr5074911a12.3.1718541969584; Sun, 16 Jun 2024 05:46:09 -0700 (PDT) Original-Received: from Pro.fritz.box (pd9e36751.dip0.t-ipconnect.de. [217.227.103.81]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb741e7a5sm5003446a12.75.2024.06.16.05.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 05:46:09 -0700 (PDT) In-Reply-To: ("=?UTF-8?Q?S=C3=A9v=C3=A8re?= Durand"'s message of "Fri, 14 Jun 2024 22:55:56 +0800") 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:287335 Archived-At: S=C3=A9v=C3=A8re Durand writes: > Hello: > > I recently found that sometimes an argument of a function is > unexpectedly set to nil when the function is natively compiled. > > A recipe to reproduce the behaviour is as follows. > > ```elisp > (defun test (&optional start) > "Test the values of START." > (message "start is %S" start) > (cond > ((not (integer-or-marker-p start)) > (message "entered first cond variant") > (setq start nil)) > ((and > (markerp start) > (not (equal (marker-buffer start) (current-buffer)))) > (message "entered second cond variant") > (setq start nil))) > (message "start is %S" start)) > (native-compile 'test) > (test 12) > ``` > > When I evaluate the above forms in sequence, I got the following two > messages: > > start is 12 > start is nil > > As can be seen from the above, no `cond` variants are triggered, so the > variable START should have the value 12, while it becomes nil at the > end. > > Sorry if this example is not minimal: I found this behaviour in my > package, so copied the relevant parts here. I am not sure what a=20 > minimal example would be. > > Hope this report is helpful. > --- > In GNU Emacs 29.3.50 (build 1, x86_64-apple-darwin23.4.0, NS > appkit-2487.50 Version 14.4.1 (Build 23E224)) of 2024-06-12 built on > MacBook-Pro-de-Severe.local I can reproduce this on macOS 14.5 x86-64 on the emacs-29 branch but not on master. Maybe Andrea (CC'd) can help.