]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not error when -E provided (PR pch/78970).
authorMartin Liska <mliska@suse.cz>
Tue, 10 Jan 2017 14:08:42 +0000 (15:08 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 10 Jan 2017 14:08:42 +0000 (14:08 +0000)
2017-01-10  Martin Liska  <mliska@suse.cz>

Backport from mainline
2017-01-09  Martin Liska  <mliska@suse.cz>

PR pch/78970
* gcc.c (driver_handle_option): Handle OPT_E and set
have_E.
(lookup_compiler): Do not show error message with have_E.

From-SVN: r244268

gcc/ChangeLog
gcc/gcc.c

index 31a9231f16e5ac8a37471bda5791ce5050ae142e..ce2f7286e304e0d9fbd7209474fcbb5a03e84866 100644 (file)
@@ -1,3 +1,13 @@
+2017-01-10  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2017-01-09  Martin Liska  <mliska@suse.cz>
+
+       PR pch/78970
+       * gcc.c (driver_handle_option): Handle OPT_E and set
+       have_E.
+       (lookup_compiler): Do not show error message with have_E.
+
 2017-01-10  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index f3b3f01209c1a889843f2ae8f76f294bf6057954..f21987f4d40ebffc8f21f2ec2670dd50ab23ef67 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1725,6 +1725,9 @@ static int have_c = 0;
 /* Was the option -o passed.  */
 static int have_o = 0;
 
+/* Was the option -E passed.  */
+static int have_E = 0;
+
 /* Pointer to output file name passed in with -o. */
 static const char *output_file = 0;
 
@@ -3822,6 +3825,10 @@ driver_handle_option (struct gcc_options *opts,
       validated = true;
       break;
 
+    case OPT_E:
+      have_E = true;
+      break;
+
     case OPT_x:
       spec_lang = arg;
       if (!strcmp (spec_lang, "none"))
@@ -7914,7 +7921,8 @@ lookup_compiler (const char *name, size_t length, const char *language)
          {
            if (name != NULL && strcmp (name, "-") == 0
                && (strcmp (cp->suffix, "@c-header") == 0
-                   || strcmp (cp->suffix, "@c++-header") == 0))
+                   || strcmp (cp->suffix, "@c++-header") == 0)
+               && !have_E)
              fatal_error (input_location,
                           "cannot use %<-%> as input filename for a "
                           "precompiled header");