Index: gcc/doc/options.texi
===================================================================
--- gcc/doc/options.texi	(revision 190642)
+++ gcc/doc/options.texi	(working copy)
@@ -468,4 +468,8 @@ of @option{-@var{opt}}, if not explicitl
 specify several different languages.  Each @var{language} must have
 been declared by an earlier @code{Language} record.  @xref{Option file
 format}.
+
+@item NoDWARFRecord
+The option is omitted from the producer string written by
+@option{-grecord-gcc-switches}.
 @end table
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 190642)
+++ gcc/dwarf2out.c	(working copy)
@@ -18138,6 +18138,9 @@ gen_producer_string (void)
 	/* Ignore these.  */
 	continue;
       default:
+        if (cl_options[save_decoded_options[j].opt_index].flags
+	    & CL_NO_DWARF_RECORD)
+	  continue;
         gcc_checking_assert (save_decoded_options[j].canonical_option[0][0]
 			     == '-');
         switch (save_decoded_options[j].canonical_option[0][1])
Index: gcc/opts.h
===================================================================
--- gcc/opts.h	(revision 190642)
+++ gcc/opts.h	(working copy)
@@ -145,6 +145,7 @@ extern const unsigned int cl_lang_count;
 #define CL_JOINED		(1U << 22) /* If takes joined argument.  */
 #define CL_SEPARATE		(1U << 23) /* If takes a separate argument.  */
 #define CL_UNDOCUMENTED		(1U << 24) /* Do not output with --help.  */
+#define CL_NO_DWARF_RECORD	(1U << 25) /* Do not add to producer string.  */

 /* Flags for an enumerated option argument.  */
 #define CL_ENUM_CANONICAL	(1 << 0) /* Canonical for this value.  */
Index: gcc/fortran/lang.opt
===================================================================
--- gcc/fortran/lang.opt	(revision 190642)
+++ gcc/fortran/lang.opt	(working copy)
@@ -295,7 +295,7 @@ Fortran Negative(nocpp)
 Enable preprocessing

 cpp=
-Fortran Joined Negative(nocpp) Undocumented
+Fortran Joined Negative(nocpp) Undocumented NoDWARFRecord
 ; Internal option generated by specs from -cpp.

 nocpp
Index: gcc/opt-functions.awk
===================================================================
--- gcc/opt-functions.awk	(revision 190642)
+++ gcc/opt-functions.awk	(working copy)
@@ -103,6 +103,7 @@ function switch_flags (flags)
 	  test_flag("JoinedOrMissing", flags, " | CL_JOINED") \
 	  test_flag("Separate", flags, " | CL_SEPARATE") \
 	  test_flag("Undocumented", flags,  " | CL_UNDOCUMENTED") \
+	  test_flag("NoDWARFRecord", flags,  " | CL_NO_DWARF_RECORD") \
 	  test_flag("Warning", flags,  " | CL_WARNING") \
 	  test_flag("Optimization", flags,  " | CL_OPTIMIZATION")
 	sub( "^0 \\| ", "", result )
