]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
options: Make --help= see overridden values
authorKewen Lin <linkw@linux.ibm.com>
Wed, 19 Aug 2020 02:37:39 +0000 (21:37 -0500)
committerMartin Liska <mliska@suse.cz>
Wed, 9 Dec 2020 20:18:13 +0000 (21:18 +0100)
Options "-Q --help=params" don't show the final values after
target option overriding, instead it emits the default values
in params.opt (without any explicit param settings).

This patch makes it see overridden values.

gcc/ChangeLog:

* opts-global.c (decode_options): Call target_option_override_hook
before it prints for --help=*.

(cherry picked from commit a7bbb5b1b1eb09db8175130474e8da952f30404b)

gcc/opts-global.c

index c658805470e473742a1cf0434ec11daa6e7583b5..5e5c3d41dd9704d203d6955c546476774b1f65ff 100644 (file)
@@ -327,8 +327,14 @@ decode_options (struct gcc_options *opts, struct gcc_options *opts_set,
   unsigned i;
   const char *arg;
 
-  FOR_EACH_VEC_ELT (help_option_arguments, i, arg)
-    print_help (opts, lang_mask, arg);
+  if (!help_option_arguments.is_empty ())
+    {
+      /* Make sure --help=* sees the overridden values.  */
+      target_option_override_hook ();
+
+      FOR_EACH_VEC_ELT (help_option_arguments, i, arg)
+       print_help (opts, lang_mask, arg);
+    }
 }
 
 /* Hold command-line options associated with stack limitation.  */