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]

[PATCH] correct checking of language options (PR 80545)


The patch for PR 80545 I committed sometime ago in r273771 needs
an additional tweak to be fully effective.  Besides a thinko
(using a bitwise OR instead of an AND) it doesn't handle common
options.  Attached is this tweak, retested on x86_64-linux.
I will go ahead and commit it shortly.

Martin
PR driver/80545 - option -Wstringop-overflow not recognized by Fortran

gcc/ChangeLog:

	PR driver/80545
	* opts-common.c (option_enabled): Correct checking for language
	options.

Index: gcc/opts-common.c
===================================================================
--- gcc/opts-common.c	(revision 274932)
+++ gcc/opts-common.c	(working copy)
@@ -1532,7 +1532,9 @@ option_enabled (int opt_idx, unsigned lang_mask, v
 
   /* A language-specific option can only be considered enabled when it's
      valid for the current language.  */
-  if (option->flags & CL_LANG_ALL && !(option->flags | lang_mask))
+  if (!(option->flags & CL_COMMON)
+      && (option->flags & CL_LANG_ALL)
+      && !(option->flags & lang_mask))
     return 0;
 
   struct gcc_options *optsg = (struct gcc_options *) opts;

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