From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS prstack Date: Mon, 27 May 2024 14:45:39 +0300 Message-ID: <86sey3v5p8.fsf@gnu.org> References: <87o790qsgm.fsf@gmail.com> <874jap95hi.fsf@gmail.com> <874janpa4m.fsf@gmail.com> <87le3vogt8.fsf@gmail.com> <87a5kbobt4.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21103"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 27 13:46:50 2024 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 1sBYoS-0005Ht-Ai for ged-emacs-devel@m.gmane-mx.org; Mon, 27 May 2024 13:46:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYnm-0007SG-1y; Mon, 27 May 2024 07:46:07 -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 1sBYnV-0007KV-FL for emacs-devel@gnu.org; Mon, 27 May 2024 07:46:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYnT-0004CX-Lv; Mon, 27 May 2024 07:45:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uIcHY3qFbBBnhJWyzDU9Y0AIOnlKTspSkO9LjUcvO8U=; b=hfD22yidK/Fz F2Mml/HiVigfrYZZTduOUFK+yGsFUyUStjccy6dfTGwNIpwdnO2dmpUEHUHZP6RKZMmKc9eVxuY4g ROAwiXWleTXA5JoiqwJKWV6Qdlsj0PySuGvtQP+F4jOynuSsdG0Q6XznLrn67HrfMWX0tgl1goRfu cUyYIpDT7+PnwBgySMuZkcGMKWa57zYZJM0rbOoFOHnCTVeEScuZU2pCiHY6GcVcRpHq+n1pR00XA m64SD8tqckdcxT3gAiZovt0wG3t3eA5NXlpjjbbMXlGIF8obWW3kTb/n/NwstnC4iTakwcAAJFBJt +CxLbR4qIxfpk8i10L2KxA==; In-Reply-To: <87a5kbobt4.fsf@gmail.com> (message from Helmut Eller on Mon, 27 May 2024 11:15:35 +0200) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319605 Archived-At: > From: Helmut Eller > Cc: Eli Zaretskii , Emacs Devel > Date: Mon, 27 May 2024 11:15:35 +0200 > > We could write > > prstack.stack[prstack.sp] = e; > prstack.sp += 1; You could, but AFAIU it's equivalent to the original code. A compiler is allowed to reorder code if doing so doesn't change the outcome. So a valid translation of the above by the compiler would be something like temp = prstack.sp; prstack.sp += 1; prstack.stack[temp] = e; > Not sure how we then guarantee that e still in a register or the control > stack at the second line. > > But my question was more whether MPS actually does call scan_prstack at > "any moment" or if this is just a theoretical possibility for some > possible future version of MPS. Why is all this order important, can you elaborate? Neither MPS nor we can rely on the order in which the generated code does this stuff, AFAIU.