public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6855] driver: do not check file existence here [PR 98452]
@ 2021-01-22 12:56 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2021-01-22 12:56 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4804de453e7f5f90dd5e64114abbd272f9e8f62d
commit r11-6855-g4804de453e7f5f90dd5e64114abbd272f9e8f62d
Author: Nathan Sidwell <nathan@acm.org>
Date: Tue Jan 19 11:43:15 2021 -0800
driver: do not check file existence here [PR 98452]
The driver checks whether OPT_SPECIAL_input_file options are readable.
There's no need, the compiler proper will do that anyway.
gcc/
* gcc.c (process_command): Don't check OPT_SPECIAL_input_file
existence here.
Diff:
---
gcc/gcc.c | 36 ++----------------------------------
1 file changed, 2 insertions(+), 34 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7dccfadfef2..aa5774af7e7 100644
--- a/gcc/gcc.c
+++ b/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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-22 12:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 12:56 [gcc r11-6855] driver: do not check file existence here [PR 98452] Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).