From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id B0CB9388BCB2; Thu, 15 Dec 2022 10:14:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0CB9388BCB2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,247,1665475200"; d="scan'208,223";a="90332652" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 15 Dec 2022 02:14:17 -0800 IronPort-SDR: lNgKGl36e9skN4COC7sh8D9vprLAfre4sP7aoxvQ76b7BK1zL8hAaoNFrjMgnovYvDoEgj/cnC QD88+aVOtxzCCNLEJYSh7LubhDVeQ0At3f7iHvSQqgSBkDiosRHz+HhA/c+igvUu4zBqKLlG5o NQaQwSUuzAcdvejZ2BPCkv4BiRvRSJlBypg3YF6TjmhzCa8JyuBRzBEVBvRKAdoMzu9PwVkqpf cCuu8y/in9GEkGoXWLjhucXJorFFlz2UgFHZV3tLKxcAHZnx4RnelFy+PuMOGNtv13BWkimEMh ils= From: Thomas Schwinge To: Richard Biener CC: , , Arthur Cohen , Subject: Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4) In-Reply-To: References: <20221206101417.778807-1-arthur.cohen@embecosm.com> <9d59ae0f-048f-dc32-6309-c8134467bbb7@embecosm.com> <87pmcla8yz.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Thu, 15 Dec 2022 11:14:10 +0100 Message-ID: <87len97z4d.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2022-12-15T08:53:13+0100, Richard Biener wr= ote: > On Wed, Dec 14, 2022 at 11:58 PM Thomas Schwinge > wrote: >> On 2022-12-13T14:40:36+0100, Arthur Cohen wr= ote: >> > We've also added one more commit, which only affects files inside the >> > Rust front-end folder. This commit adds an experimental flag, which >> > blocks the compilation of Rust code when not used. >> >> (That's commit r13-4675-gb07ef39ffbf4e77a586605019c64e2e070915ac3 >> "gccrs: Add fatal_error when experimental flag is not present".) >> >> I noticed that GCC/Rust recently lost all LTO variants in torture >> testing -- due to this commit. :-O >> >> OK to push the attached >> "Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common= ' option", >> or should this be done differently? > > Just add 'LTO' to the option in lang.opt, like > > frust-incomplete-and-experimental-compiler-do-not-use > Rust LTO Var(flag_rust_experimental) > Enable experimental compilation of Rust files at your own risk That doesn't work; it's 'cc1' that is complaining here. Gr=C3=BC=C3=9Fe Thomas >> With that, we get back: >> >> PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O0 (t= est for excess errors) >> PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O1 (t= est for excess errors) >> PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 (t= est for excess errors) >> +PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 -fl= to -fno-use-linker-plugin -flto-partition=3Dnone (test for excess errors) >> +PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 -fl= to -fuse-linker-plugin -fno-fat-lto-objects (test for excess errors) >> PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O3 -g = (test for excess errors) >> PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -Os (t= est for excess errors) >> >> Etc., and in total: >> >> =3D=3D=3D rust Summary for unix =3D=3D=3D >> >> # of expected passes [-4990-]{+6718+} >> # of expected failures [-39-]{+51+} >> >> >> Gr=C3=BC=C3=9Fe >> Thomas >> >> >> > We hope this helps >> > indicate to users that the compiler is not yet ready, but can still be >> > experimented with :) >> > >> > We plan on removing that flag as soon as possible, but in the meantime= , >> > we think it will help not creating divide within the Rust ecosystem, a= s >> > well as not waste Rust crate maintainers' time. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Make-frust-incomplete-and-experimental-compiler-do-n.patch" >From 3b2a8a4df1637a0cad738165a2afa9b34e286fcf Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 14 Dec 2022 17:16:42 +0100 Subject: [PATCH] Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option I noticed that GCC/Rust recently lost all LTO variants in torture testing: PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O0 (test for excess errors) PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O1 (test for excess errors) PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 (test for excess errors) -PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors) -PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects (test for excess errors) PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -O3 -g (test for excess errors) PASS: rust/compile/torture/all_doc_comment_line_blocks.rs -Os (test for excess errors) Etc. The reason is that when probing for availability of LTO, we run into: spawn [...]/build-gcc/gcc/testsuite/rust/../../gccrs -B[...]/build-gcc/gcc/testsuite/rust/../../ -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -flto -c -o lto8274.o lto8274.c cc1: warning: command-line option '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust but not for C For GCC/Rust testing, this flag is defaulted in 'gcc/testsuite/lib/rust.exp:rust_init': lappend ALWAYS_RUSTFLAGS "additional_flags=-frust-incomplete-and-experimental-compiler-do-not-use" Make it generally accepted without "is valid for Rust but not for [...]" diagnostic. gcc/rust/ * lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use): Remove. gcc/ * common.opt (-frust-incomplete-and-experimental-compiler-do-not-use): New. --- gcc/common.opt | 6 ++++++ gcc/rust/lang.opt | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index 562d73d7f552..eba28e650f94 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2552,6 +2552,12 @@ frounding-math Common Var(flag_rounding_math) Optimization SetByCombined Disable optimizations that assume default FP rounding behavior. +; This option applies to Rust only, but is defined 'Common' here, so that it's +; generally accepted without "is valid for Rust but not for [...]" diagnostic. +frust-incomplete-and-experimental-compiler-do-not-use +Common Var(flag_rust_experimental) +Enable experimental compilation of Rust files at your own risk. + fsched-interblock Common Var(flag_schedule_interblock) Init(1) Optimization Enable scheduling across basic blocks. diff --git a/gcc/rust/lang.opt b/gcc/rust/lang.opt index 63732a636a3d..6187fbf29352 100644 --- a/gcc/rust/lang.opt +++ b/gcc/rust/lang.opt @@ -66,10 +66,6 @@ frust-dump- Rust Joined RejectNegative -frust-dump- Dump Rust frontend internal information. -frust-incomplete-and-experimental-compiler-do-not-use -Rust Var(flag_rust_experimental) -Enable experimental compilation of Rust files at your own risk - frust-max-recursion-depth= Rust RejectNegative Type(int) Var(rust_max_recursion_depth) Init(64) -frust-max-recursion-depth=integer -- 2.35.1 --=-=-=--