From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS prstack Date: Mon, 27 May 2024 11:47:03 +0200 Message-ID: References: <87o790qsgm.fsf@gmail.com> <874jap95hi.fsf@gmail.com> <874janpa4m.fsf@gmail.com> <87le3vogt8.fsf@gmail.com> <87a5kbobt4.fsf@gmail.com> 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="4380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Emacs Devel To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 27 11:47:57 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 1sBWxQ-0000yn-MX for ged-emacs-devel@m.gmane-mx.org; Mon, 27 May 2024 11:47:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBWwi-0003x5-9D; Mon, 27 May 2024 05:47:12 -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 1sBWwg-0003wE-FJ for emacs-devel@gnu.org; Mon, 27 May 2024 05:47:10 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBWwe-0006pt-39; Mon, 27 May 2024 05:47:09 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5789733769dso2559920a12.1; Mon, 27 May 2024 02:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716803225; x=1717408025; darn=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=Yq/MiSkzYvgBvTlapMnxuHh3rBSLSy3WfDmEIF9U1vg=; b=je8PVUWeqvvBrdRAWDHQPWTupwqcFK8MY+9bqerIGCdo2LX6mQciJOiwkyH5IIgNG1 lgZ+RxqBV++wsYZVbsB8QioHmlPlJWJrwlT8Bhq55pbmhqpt9fmSx0hyRVgdF8KBgB94 cEy9imdMMEwsgyDiMRey+V7DNf76xO551tJWEaWb3TAToY6hIx4mivewBvzLohtzE7IZ 9XZHpODlQpnBgMpgIZE3uAolrR7HUpluzVsyJnHQ3XdI/1XmKtqMW89z7DsQ9IgKnn/v 5RV+qU0BGa8AWlP0gljSwGbH3uNTw5rQCc9cSGNYOdI3e5gmSEoJ+YnCwjZr+/ogAYud jWMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716803225; x=1717408025; 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=Yq/MiSkzYvgBvTlapMnxuHh3rBSLSy3WfDmEIF9U1vg=; b=AnqVZCO9avA0zIL/rdzA7/S+1sm/2IwWZ102ClkXy7ru4bV6H8YIeCu7yQdGmHaza5 vjKW75ld6vO94M2cJSAL/en38tFg2N6H1rE6IZvsBiphpXCPIMFsjjd1JJ6bKSRRzrIu +YjNqmyIC/gDZ1s2nHo5JHyh7NfWm5CJEgpVoMJCami4kl1kuAqmllHPQw1cl9CaiZlb YDxE9EonwshLp+UW/Bi7If85Bc9aXcr5hpiDpOzysVA3gg8Zg/uglqnDf0dCJbe13IrZ PT9h+VcfU4M2KsGNaUE3WrqJGxC7k39YasvRh1EyqAScTT1o6VAPNTzvHjiTT7cip/0s K1AQ== X-Forwarded-Encrypted: i=1; AJvYcCV4aKXqe6vc9iGOqnMWA6Qhqt71WrVwegw4wN5qitZVWxqn+VeEQ/0GhUM4INA+EhiWUpQjp4I1VPSFeCulJbSdr2so X-Gm-Message-State: AOJu0YzSLwitr42Fg4iWhyGbml86jtqYTHbeoMHpbEE+A5+El++3Azw2 VfawkdGVDEYRNcXwHl+hHm/YmUcjnsAwigYw9Nn8zNES36zqwMnVtKTYQg== X-Google-Smtp-Source: AGHT+IFeyqavPOZMs/F29I80JlaI9Erxkg45D1+OpC6i+hNlJI3MWzRqHXtRQodmw6T3GPOcopp/PQ== X-Received: by 2002:a17:906:b0cf:b0:a59:aa7a:3b16 with SMTP id a640c23a62f3a-a62616defe6mr761020566b.4.1716803224449; Mon, 27 May 2024 02:47:04 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3aaf8.dip0.t-ipconnect.de. [79.227.170.248]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc8da37sm473106666b.183.2024.05.27.02.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 02:47:04 -0700 (PDT) In-Reply-To: <87a5kbobt4.fsf@gmail.com> (Helmut Eller's message of "Mon, 27 May 2024 11:15:35 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319602 Archived-At: Helmut Eller writes: > On Mon, May 27 2024, Gerd M=C3=B6llmann wrote: > >>> prstack.stack[prstack.sp++] =3D e; >> >> Hm. No idea when the increment is sequenced. The side effect of postfix >> ++ could be applied anywhere before the next sequence point. But where >> is that sequence point? There is one at the end of the whole expression >> I think. > > The generated code with O0 looks like this: > > ... > 0x000055555587fcb1 <+28>: call 0x55555587fbd0 > 0x000055555587fcb6 <+33>: mov 0x8845c3(%rip),%rcx # 0x555= 556104280 > 0x000055555587fcbd <+40>: mov 0x8845cc(%rip),%rax # 0x555= 556104290 > 0x000055555587fcc4 <+47>: lea 0x1(%rax),%rdx > 0x000055555587fcc8 <+51>: mov %rdx,0x8845c1(%rip) # 0x555= 556104290 > 0x000055555587fccf <+58>: mov %rax,%rdx > 0x000055555587fcd2 <+61>: mov %rdx,%rax > 0x000055555587fcd5 <+64>: shl $0x3,%rax > 0x000055555587fcd9 <+68>: sub %rdx,%rax > 0x000055555587fcdc <+71>: shl $0x3,%rax > 0x000055555587fce0 <+75>: add %rcx,%rax > 0x000055555587fce3 <+78>: mov 0x10(%rbp),%rcx > 0x000055555587fce7 <+82>: mov 0x18(%rbp),%rbx > ... > > So it looks like prstack.sp is updated with the move at +51, i.e. before > the stack slot is initialized. > > We could write > > prstack.stack[prstack.sp] =3D e; > prstack.sp +=3D 1; > > 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. I think it is "at any moment". At least I can't find anything in the docs hinting at something else. Which probably means that we can't wholy trust stack points. They may be off.