From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MPS prstack Date: Mon, 27 May 2024 11:15:35 +0200 Message-ID: <87a5kbobt4.fsf@gmail.com> References: <87o790qsgm.fsf@gmail.com> <874jap95hi.fsf@gmail.com> <874janpa4m.fsf@gmail.com> <87le3vogt8.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="34566"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Emacs Devel To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 27 11:16:45 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 1sBWTC-0008ni-OP for ged-emacs-devel@m.gmane-mx.org; Mon, 27 May 2024 11:16:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBWSF-0007dB-Df; Mon, 27 May 2024 05:15:43 -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 1sBWSC-0007bO-K3 for emacs-devel@gnu.org; Mon, 27 May 2024 05:15:40 -0400 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBWSA-0001O2-RO; Mon, 27 May 2024 05:15:40 -0400 Original-Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5751bcb3139so12605430a12.1; Mon, 27 May 2024 02:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716801337; x=1717406137; 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=XZD+oeWYZE1EOAx60FRRedYG6DU4aBYTPQ1fS8RirSQ=; b=Ynk089b4iZfuTz8j2Tc2E+/UgnAc97CqHvjbvIeZP9wSgcS3yFgLZfgDecT2+G1E+l Tf28GFBZZjx4e4mJA0wjocFB4GbKQVelaonCzQPsJ3ilRgTsSeiu+Falmkd85Nl7vwpm 7HXi+jaCQFulEK8DPyPJrEFfBcQU+iE1iwCYHobdztNDO8bnqImGn368xQTD+iRmRKQk EkuzeKhlZVmohNrxkqfxn5aJLRhKN8p5Ot3oF66W66YmyT+o0FIRZVffeDDaRlnXnwAo fN5LqvkcR9ttMOv7FDqCyNYsvse61DCT8+APK5fwzm/WMAL3u87Jl8rQre3FpHjzFywV /R5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716801337; x=1717406137; 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=XZD+oeWYZE1EOAx60FRRedYG6DU4aBYTPQ1fS8RirSQ=; b=QlVZqsU4TsxdwIASILlcmz7Tyz9Sl69f7DdC8KbTkA/9UiJhRBsDSfuSMx0YgNJHId gtFPurfIUunSR47k0KfdMEGEzrLO0aY4CVSLExL2FNhBW+uyNJsBJkqXipQ+jKnfyLl4 nd9U8arosHVQrTyiGD4hW2ZkJGrihEEX6WaN1xqGH5MnDEIBq1vXdCz8Trb/PhrHCzPX xEdLXjiN9U+JvZnJW/q5J6WPfagfqexCh7HhPMwEqBzTbiaKracc7+3PfTLJ0Vwm0mDv gerHr/TgZXNVp/d14r2gPCHlox9dfGBUbOCZ2VzrRKTfZyHbB/fBl70Md9g4XmCPIuO+ TR5w== X-Forwarded-Encrypted: i=1; AJvYcCVpHIrNqpzscKa27EflBwQhpKRau/03zOLbLh6qDiRUqfKnfLy7LdYA46I4SJ/4pK9DgVw6F153coeEMIv2NgQXeaQp X-Gm-Message-State: AOJu0YxZWwE/EE9MuSo/bT4BHNkWFH0csmssSkWreKCgp3+GOWmpsfrG RNHhnJRBUROIWBuBRE5m9Mo+aAhHy784/JJ2HoKErbM/F1Pt9tQU1DVUlw== X-Google-Smtp-Source: AGHT+IHQbz/WANzv23yMXKz1rFsRa5ZCDK4PrvGU8zduvW81Adisusd3thQ8nMbC48m9V350e958HQ== X-Received: by 2002:a17:907:1b86:b0:a52:65bd:a19a with SMTP id a640c23a62f3a-a6264f018eamr510644566b.57.1716801336467; Mon, 27 May 2024 02:15:36 -0700 (PDT) Original-Received: from caladan (dial-188233.pool.broadband44.net. [212.46.188.233]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c9377d8sm468738766b.55.2024.05.27.02.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 02:15:36 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Mon, 27 May 2024 10:43:24 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=eller.helmut@gmail.com; helo=mail-ed1-x535.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:319601 Archived-At: 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 # 0x55555= 6104280 0x000055555587fcbd <+40>: mov 0x8845cc(%rip),%rax # 0x55555= 6104290 0x000055555587fcc4 <+47>: lea 0x1(%rax),%rdx 0x000055555587fcc8 <+51>: mov %rdx,0x8845c1(%rip) # 0x55555= 6104290 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.