Joseph,
I was relying on this patch on the modules branch, but didn't realize the implications when merging and thought it was just a cleanup. I'm not sure why the driver wants to check here, rather than leave it to the compiler. Seems optimizing for failure? The only difference I can think is that the diagnostic might mention the driver name, rather than say (cc1plus), but that's a different problem that I've also reported.

The existing code seems confused anyway, we look for NAME, but then report NAME + 1 if name's initial char indicates a response file '@'. IMHO if that's some subtle way of giving an error for an (already) failed missing response file, it seems odd.

The failure for modules concerns -x c++-system-header (or c++-user-header), where the compiler will search for the file on the appropriate include path.

booted & tested on x86_64-linux, ok?

        gcc/
        * gcc.c (process_command): Don't check OPT_SPECIAL_input_file
        existence here.

--
Nathan Sidwell
diff --git i/gcc/gcc.c w/gcc/gcc.c
index 7dccfadfef2..aa5774af7e7 100644
--- i/gcc/gcc.c
+++ w/gcc/gcc.c
@@ -4811,44 +4811,12 @@ process_command (unsigned int decoded_options_count,
       if (decoded_options[j].opt_index == OPT_SPECIAL_input_file)
 	{
 	  const char *arg = decoded_options[j].arg;
-          const char *p = strrchr (arg, '@');
-          char *fname;
-	  long offset;
-	  int consumed;
+
 #ifdef HAVE_TARGET_OBJECT_SUFFIX
 	  arg = convert_filename (arg, 0, access (arg, F_OK));
 #endif
-	  /* For LTO static archive support we handle input file
-	     specifications that are composed of a filename and
-	     an offset like FNAME@OFFSET.  */
-	  if (p
-	      && p != arg
-	      && sscanf (p, "@%li%n", &offset, &consumed) >= 1
-	      && strlen (p) == (unsigned int)consumed)
-	    {
-              fname = (char *)xmalloc (p - arg + 1);
-              memcpy (fname, arg, p - arg);
-              fname[p - arg] = '\0';
-	      /* Only accept non-stdin and existing FNAME parts, otherwise
-		 try with the full name.  */
-	      if (strcmp (fname, "-") == 0 || access (fname, F_OK) < 0)
-		{
-		  free (fname);
-		  fname = xstrdup (arg);
-		}
-	    }
-	  else
-	    fname = xstrdup (arg);
-
-          if (strcmp (fname, "-") != 0 && access (fname, F_OK) < 0)
-	    {
-	      bool resp = fname[0] == '@' && access (fname + 1, F_OK) < 0;
-	      error ("%s: %m", fname + resp);
-	    }
-          else
-	    add_infile (arg, spec_lang);
+	  add_infile (arg, spec_lang);
 
-          free (fname);
 	  continue;
 	}
 

Reply via email to