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: 30.0.50; GCC 13.1 breaks building Emacs with native-compilation Date: Fri, 16 Jun 2023 10:49:13 -0400 Message-ID: References: <831qibu29t.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="14306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63365@debbugs.gnu.org, arash@gnu.org, svraka.andras@gmail.com, Cyril Arnould To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 16 16:50:17 2023 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 1qAAmG-0003X1-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Jun 2023 16:50:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAAm3-0006En-JY; Fri, 16 Jun 2023 10:50:03 -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 1qAAm2-0006Ed-8g for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 10:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAAm1-0003ji-WD for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 10:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAAm1-0003HI-SR for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 10:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jun 2023 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63365 X-GNU-PR-Package: emacs Original-Received: via spool by 63365-submit@debbugs.gnu.org id=B63365.168692696412548 (code B ref 63365); Fri, 16 Jun 2023 14:50:01 +0000 Original-Received: (at 63365) by debbugs.gnu.org; 16 Jun 2023 14:49:24 +0000 Original-Received: from localhost ([127.0.0.1]:50181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAAlO-0003GI-SV for submit@debbugs.gnu.org; Fri, 16 Jun 2023 10:49:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAAlL-0003G0-KC for 63365@debbugs.gnu.org; Fri, 16 Jun 2023 10:49:21 -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 1qAAlF-0003bp-Kw; Fri, 16 Jun 2023 10:49:13 -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=WNPpHoFhXAIczwHlimps0hutsXiABF+bHpWT0jm115A=; b=UJZlm2nHoyotRRFsxDdU hdS1FVluhNFadAN1rXF0YkMGzVoOxffmGlkuYUoCikQrAMbEpue/xaZk8qf+64svz/OTXJMf08sRF mdmu3osnzpa1pG/zsQdhCzLWR4pXgQA8HrY/hYM5ecPr48jSC2BX5hlBW0UELPIeNnPZmbj/PAjSy 2SOxeXPDyYtgkh3mPg51Q/07XqAQu7l/ebZs5ueOCuftAJ/ile3xjyYG2gQvbI7dC+umT4ZN+RcBm DCalxdT4V+PlYmKUR68c4GjJQ0lj3d8qr1MBpwNORTAHPCDydo4B6+qXL4b8Dk2DPcrBKYMHF+goN AUzxn9IjJDs33w==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qAAlF-0003AE-9P; Fri, 16 Jun 2023 10:49:13 -0400 In-Reply-To: <831qibu29t.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Jun 2023 13:31:26 +0300") 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:263473 Archived-At: Eli Zaretskii writes: >> From: Cyril Arnould >> CC: "eliz@gnu.org" , "63365@debbugs.gnu.org" >> <63365@debbugs.gnu.org>, " akrl@sdf.org" , >> Andr=C3=A1s Svraka >> Date: Fri, 16 Jun 2023 09:04:16 +0000 >>=20 >> I've been playing around with compiler options. From my findings, the >>=20 >> -foptimize-sibling-calls flag breaks the build: >>=20 >>=20=20 >>=20 >> ./autogen.sh >>=20 >> CFLAGS=3D'-g3 -O1 -gdwarf-2 -foptimize-sibling-calls' \ >>=20 >> ./configure --with-native-compilation >>=20 >> make >>=20 >>=20=20 >>=20 >> OTOH, using -O1 with every flag listed under -O2 *but* >>=20 >> -foptimize-sibling-calls results in the build succeeding. The following >>=20 >> works as well for me: >>=20 >>=20=20 >>=20 >> ./autogen.sh >>=20 >> CFLAGS=3D'-g3 -O2 -gdwarf-2 -fno-optimize-sibling-calls' \ >>=20 >> ./configure --with-native-compilation >>=20 >> make > > Andrea, any reason that this GCC switch should break > native-compilation? At this point I start to suspect that this is not strictly related to native compilation. The configure flags are used only for our regular C code and not for Elisp native compilation. So it might be that some kind of misscompilaiton of our C code is happening only with --with-native-compilation, but looks to me it's not our compiler or libgccjit the issue here. > Does the same problem happen on GNU/Linux? I tried now on GCC 13.1.1 git clean -xfd && ./autogen.sh CFLAGS=3D'-g3 -O1 -gdwarf-2 -foptimize-sibling-calls' ./configure --with-native-compilation && make -j16 and have complete bootstrap succesfully on emacs-29 (65f355ea0a3), my dev machine is still x86_64-pc-linux-gnu. One idea might be asking GCC to log what optimize-sibling-calls is doing and see if any of our C function supporting native compilation is touched by this pass (I believe is called in GCC tree-tailcall). CFLAGS=3D'-g3 -O1 -gdwarf-2 -foptimize-sibling-calls -fdump-tree-tailr' && = make bootstrap should let GCC dump what this pass is for each C compilation unit, I'd start looking at the output for comp.c (I've comp.c.045t.tailr1 and comp.c.= 125t.tailr2).=20=20 Hope it helps! Andrea