From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AF545382FC90 for ; Thu, 15 Dec 2022 11:16:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF545382FC90 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671103010; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=jb1g+NyGYseQsbDP04dR0iSC+CYbsIDwdjbJQbcSSZ4=; b=AEM8vegtOqhBgsZ1dsjZ1LBe2/m4fUkoPIaFFnJypF9Q4t/h9yYiykfWnGMfd44dDuyn+/ zsGdmYrEPjPJYDBD+g5TmXNreITNvQE1jCX9gvA9fC+N/QE7zeB+OhFzGbvesaGGT48i4Y 6xCBziKwO3UkX3AkHaPcm/BymjO+dsA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-1Ibf8MTKPMCoFmpOJvCKGA-1; Thu, 15 Dec 2022 06:16:47 -0500 X-MC-Unique: 1Ibf8MTKPMCoFmpOJvCKGA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EAD423806636; Thu, 15 Dec 2022 11:16:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A86E81D0A8; Thu, 15 Dec 2022 11:16:45 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2BFBGe9S3306094 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 12:16:40 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2BFBGcVM3306093; Thu, 15 Dec 2022 12:16:38 +0100 Date: Thu, 15 Dec 2022 12:16:37 +0100 From: Jakub Jelinek To: Thomas Schwinge Cc: Richard Biener , gcc-patches@gcc.gnu.org, joseph@codesourcery.com, Arthur Cohen , gcc-rust@gcc.gnu.org Subject: Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4) Message-ID: Reply-To: Jakub Jelinek References: <20221206101417.778807-1-arthur.cohen@embecosm.com> <9d59ae0f-048f-dc32-6309-c8134467bbb7@embecosm.com> <87pmcla8yz.fsf@euler.schwinge.homeip.net> <87len97z4d.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 In-Reply-To: <87len97z4d.fsf@dem-tschwing-1.ger.mentorg.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On Thu, Dec 15, 2022 at 11:14:10AM +0100, Thomas Schwinge wrote: > Hi! > > On 2022-12-15T08:53:13+0100, Richard Biener wrote: > > On Wed, Dec 14, 2022 at 11:58 PM Thomas Schwinge > > wrote: > >> On 2022-12-13T14:40:36+0100, Arthur Cohen wrote: > >> > 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. In that case it is a testsuite issue. I really think making such Rust option a common option is very much undesirable. We seem to have a problem in other testsuites too: grep ' valid for .*but not for' */*.log | sort -u gcc/gcc.log:/home/jakub/src/gcc/gcc/testsuite/gcc.dg/pragma-diag-6.c:2:30: warning: option '-Wnoexcept' is valid for C++/ObjC++ but not for C [-Wpragmas] gdc/gdc.log:cc1plus: warning: command-line option '-fextern-std=c++11' is valid for D but not for C++ gdc/gdc.log:cc1plus: warning: command-line option '-fpreview=in' is valid for D but not for C++ gfortran/gfortran.log:cc1: warning: command-line option '-fcheck=all' is valid for Fortran but not for C g++/g++.log:cc1: warning: command-line option '-nostdinc++' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++11' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++14' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++17' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++20' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++23' is valid for C++/ObjC++ but not for C g++/g++.log:cc1: warning: command-line option '-std=gnu++98' is valid for C++/ObjC++ but not for C rust/rust.log:cc1plus: warning: command-line option '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust but not for C++ rust/rust.log:cc1: warning: command-line option '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust but not for C (of course, some of them could be from tests that this valid for but not for messages work right, that is clearly the case of pragma-diag-6.c). In gcc/testsuite/lib/target-supports.exp (check_compile) we already determine extension for the check_compile snippet based on magic comments with default to .c (Rust nor Modula 2 don't have any, should that be changed?), shouldn't we at that point based on the language filter out known options that will not work? So, given the above, at least when in gdc testsuite and language is not D filter out -fextern-std=* and -fpreview=in, for gfortran testsuite and language not Fortran filter out -fcheck=all, when in g++ testsuite and language is not C++ filter out -nostdinc++, -std=gnu++* and when in rust testsuite and language is not Rust filter out -frust-incomplete-and-experimental-compiler-do-not-use ? Jakub