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