This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gcc -v --help (PR middle-end/37576)


On Tue, Oct 07, 2008 at 07:35:00AM -0700, Ian Lance Taylor wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> Why is CL_SAVE listed with the option classes rather than the option
> attributes?  It seems to me that CL_SAVE should move to the subsequent
> list in opts.h (the one starting with CL_DISABLED) and that
> CL_MIN_OPTION_CLASS should be set back to CL_PARAMS.  At least, I
> can't see why on would ever want to set CL_SAVE without also setting
> CL_TARGET.
> 
> Moving CL_SAVE in that way seems right and should accomplish the same
> goal as this patch.

I've bootstrapped/regtested following on x86_64-linux.  Ok for trunk then?

2008-10-07  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/37576
	* opts.h (CL_SAVE): Move up to flags range.
	(CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_TARGET,
	CL_COMMON): Renumber.
	(CL_MIN_OPTION_CLASS): Set to CL_PARAMS.
	* opts.c (common_handle_option): Revert last change.

--- gcc/opts.h.jj	2008-09-30 16:57:11.000000000 +0200
+++ gcc/opts.h	2008-10-07 20:51:52.000000000 +0200
@@ -65,14 +65,13 @@ extern const unsigned int cl_options_cou
 extern const char *const lang_names[];
 extern const unsigned int cl_lang_count;
 
-#define CL_SAVE			(1 << 17) /* Target-specific option for attribute.  */
-#define CL_PARAMS               (1 << 18) /* Fake entry.  Used to display --param info with --help.  */
-#define CL_WARNING		(1 << 19) /* Enables an (optional) warning message.  */
-#define CL_OPTIMIZATION		(1 << 20) /* Enables an (optional) optimization.  */
-#define CL_TARGET		(1 << 21) /* Target-specific option.  */
-#define CL_COMMON		(1 << 22) /* Language-independent.  */
+#define CL_PARAMS               (1 << 17) /* Fake entry.  Used to display --param info with --help.  */
+#define CL_WARNING		(1 << 18) /* Enables an (optional) warning message.  */
+#define CL_OPTIMIZATION		(1 << 19) /* Enables an (optional) optimization.  */
+#define CL_TARGET		(1 << 20) /* Target-specific option.  */
+#define CL_COMMON		(1 << 21) /* Language-independent.  */
 
-#define CL_MIN_OPTION_CLASS	CL_SAVE
+#define CL_MIN_OPTION_CLASS	CL_PARAMS
 #define CL_MAX_OPTION_CLASS	CL_COMMON
 
 /* From here on the bits describe attributes of the options.
@@ -80,6 +79,7 @@ extern const unsigned int cl_lang_count;
    This distinction is important because --help will not list options
    which only have these higher bits set.  */
 
+#define CL_SAVE			(1 << 22) /* Target-specific option for attribute.  */
 #define CL_DISABLED		(1 << 23) /* Disabled in this configuration.  */
 #define CL_REPORT		(1 << 24) /* Report argument with -fverbose-asm  */
 #define CL_JOINED		(1 << 25) /* If takes joined argument.  */
--- gcc/opts.c.jj	2008-09-30 16:57:11.000000000 +0200
+++ gcc/opts.c	2008-10-07 20:52:08.000000000 +0200
@@ -1459,8 +1459,7 @@ common_handle_option (size_t scode, cons
 	print_specific_help (0, undoc_mask, all_langs_mask);
 	/* Then display any remaining, non-language options.  */
 	for (i = CL_MIN_OPTION_CLASS; i <= CL_MAX_OPTION_CLASS; i <<= 1)
-	  if (i != CL_SAVE)
-	    print_specific_help (i, undoc_mask, 0);
+	  print_specific_help (i, undoc_mask, 0);
 	exit_after_options = true;
 	break;
       }

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]