From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#63365: bug#65727: 30.0.50; Build failure in MSYS2 when --with-native-compilation Date: Tue, 14 May 2024 16:33:53 -0400 Message-ID: References: <86wn1jtezk.fsf@gnu.org> 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="23478"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "63365@debbugs.gnu.org" <63365@debbugs.gnu.org>, "eliz@gnu.org" , 65727@debbugs.gnu.org, Arash Esbati , =?UTF-8?Q?Andr=C3=A1s?= Svraka To: Cyril Arnould Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 14 22:37:30 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 1s6ytt-0005tS-BS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 May 2024 22:37:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6ytS-0006Ux-A7; Tue, 14 May 2024 16:37:02 -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 1s6ytR-0006Ul-Nq for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:37:01 -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 1s6ytR-0003ZD-Fa for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6ytS-00024c-ET for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63365 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 63365-submit@debbugs.gnu.org id=B63365.17157189797959 (code B ref 63365); Tue, 14 May 2024 20:37:02 +0000 Original-Received: (at 63365) by debbugs.gnu.org; 14 May 2024 20:36:19 +0000 Original-Received: from localhost ([127.0.0.1]:41408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6ysk-00024I-HD for submit@debbugs.gnu.org; Tue, 14 May 2024 16:36:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6ysf-000242-77; Tue, 14 May 2024 16:36:17 -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 1s6yqS-0002pa-AF; Tue, 14 May 2024 16:33:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=vx96umDErrXGaaVnk2whmnZekzftedDF6lzqqtqGEKE=; b=NOWvhzOepcCgwf+xfXu5 vaYGMM0lm/aR+F6WHdiKjxO0D7NX7udX8aajxNaZ0lY+hhyCHq4oqemWhVrmExerdkOtwTESBHiys CMgBBUKhhYrA233XewlEUu6Cn6h7XynYL3n6tVOn9FaSJ4FBdao5P+aTLQiTRs2hWOTHBZ8Dq/+tS 9lhecF5XfO4nhi7S8IUD1pCDiXX1E2sNk+YN8V04sJBHGjt/JCW9bqxfPcS5gRSMpSdJsS2j6uhce M0XanT4cYHCqb+arPK3t3PsARAU+ThZxstESAjvqPs7srnXk85HwGFQKewGWvYNos7Dd7ICJmF0XV 1jdfteugzM0ziQ==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1s6yqP-0000Mm-Rl; Tue, 14 May 2024 16:33:54 -0400 In-Reply-To: (Cyril Arnould's message of "Tue, 14 May 2024 21:52:42 +0200") 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:285051 Archived-At: Cyril Arnould writes: > I believe the problem is centered around the mark_threads function (in > thread.c). I still have no idea if the issue is with emacs or GCC, but > I hope this helps narrow it down. > > I found it by trying to suppress the sibling call optimization through > printf statements at the end of every function that showed differences > between the objdump files. With the additional printf calls, the > native-compilation build works together with the > -foptimize-sibling-calls flag. > > After that, it was just a matter of narrowing it down. You can try it > for yourself with the following patch: > > diff --git a/src/thread.c b/src/thread.c > index 040ca39511e..b522d146779 100644 > --- a/src/thread.c > +++ b/src/thread.c > @@ -696,6 +696,7 @@ mark_threads_callback (void *ignore) > =C2=A0mark_threads (void) > =C2=A0{ > =C2=A0=C2=A0 flush_stack_call_func (mark_threads_callback, NULL); > +=C2=A0 printf(""); > =C2=A0} > > =C2=A0void > > Note that by now I've moved on to emacs-29.3 on GCC 14, however it > seems that the issue is still exactly the same. Interesting, would you mind instead of using 'printf' to try using '__attribute__((optimize("O0")))' on the function to verify that the issue is really an optimization? Thanks Andrea