+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * diagnostic.c (fatal_error (const char *, ...)): Remove function.
+ * diagnostic-core.h (fatal_error (const char *, ...)): Remove
+ prototype.
+ * toplev.h (init_asm_output): Update comment on use of
+ UNKNOWN_LOCATION with fatal_error.
+ * cgraph.c, collect-utils.c, collect2.c, config/arc/arc.c,
+ config/arc/arc.md, config/avr/avr.c, config/c6x/c6x.h,
+ config/darwin.c, config/host-darwin.c, config/i386/host-cygwin.c,
+ config/i386/intelmic-mkoffload.c, config/nios2/nios2.c,
+ config/nvptx/mkoffload.c, config/nvptx/nvptx.h,
+ config/rs6000/host-darwin.c, config/rs6000/rs6000.c,
+ config/s390/s390.c, gcc.c, gcov-io.h, gcov-tool.c, ggc-common.c,
+ ggc-page.c, graph.c, ipa-inline-analysis.c, ipa-reference.c,
+ lto-cgraph.c, lto-section-in.c, lto-streamer-in.c, lto-streamer.c,
+ lto-wrapper.c, objc/objc-act.c, opts.c, passes.c, plugin.c,
+ tlink.c, toplev.c, tree-streamer-in.c, varpool.c: All callers of
+ fatal_error changed to pass input_location as first argument.
+
2015-01-30 Martin Liska <mliska@suse.cz>
* tree.h: Change GCC_VERSION >= 4004 to GCC_VERSION >= 4006
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * c-opts.c, c-pch.c, cppspec.c: All callers of fatal_error changed
+ to pass input_location as first argument.
+
2015-01-23 Tom de Vries <tom@codesourcery.com>
PR libgomp/64672
if (out_stream == NULL)
{
- fatal_error ("opening output file %s: %m", out_fname);
+ fatal_error (input_location, "opening output file %s: %m", out_fname);
return false;
}
{
deps_stream = fopen (deps_file, deps_append ? "a": "w");
if (!deps_stream)
- fatal_error ("opening dependency file %s: %m", deps_file);
+ fatal_error (input_location, "opening dependency file %s: %m",
+ deps_file);
}
}
if (deps_stream && deps_stream != out_stream
&& (ferror (deps_stream) || fclose (deps_stream)))
- fatal_error ("closing dependency file %s: %m", deps_file);
+ fatal_error (input_location, "closing dependency file %s: %m", deps_file);
if (out_stream && (ferror (out_stream) || fclose (out_stream)))
- fatal_error ("when writing output to %s: %m", out_fname);
+ fatal_error (input_location, "when writing output to %s: %m", out_fname);
}
/* Either of two environment variables can specify output of
f = fopen (pch_file, "w+b");
if (f == NULL)
- fatal_error ("can%'t create precompiled header %s: %m", pch_file);
+ fatal_error (input_location, "can%'t create precompiled header %s: %m",
+ pch_file);
pch_outfile = f;
gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0);
|| fwrite (executable_checksum, 16, 1, f) != 1
|| fwrite (&v, sizeof (v), 1, f) != 1
|| fwrite (target_validity, v.target_data_length, 1, f) != 1)
- fatal_error ("can%'t write to %s: %m", pch_file);
+ fatal_error (input_location, "can%'t write to %s: %m", pch_file);
/* Let the debugging format deal with the PCHness. */
(*debug_hooks->handle_pch) (0);
if (fseek (pch_outfile, 0, SEEK_SET) != 0
|| fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1)
- fatal_error ("can%'t write %s: %m", pch_file);
+ fatal_error (input_location, "can%'t write %s: %m", pch_file);
fclose (pch_outfile);
sizeread = read (fd, ident, IDENT_LENGTH + 16);
if (sizeread == -1)
- fatal_error ("can%'t read %s: %m", name);
+ fatal_error (input_location, "can%'t read %s: %m", name);
else if (sizeread != IDENT_LENGTH + 16)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
executable, so it ought to be long enough that we can read a
c_pch_validity structure. */
if (read (fd, &v, sizeof (v)) != sizeof (v))
- fatal_error ("can%'t read %s: %m", name);
+ fatal_error (input_location, "can%'t read %s: %m", name);
/* The allowable debug info combinations are that either the PCH file
was built with the same as is being used now, or the PCH file was
if ((size_t) read (fd, this_file_data, v.target_data_length)
!= v.target_data_length)
- fatal_error ("can%'t read %s: %m", name);
+ fatal_error (input_location, "can%'t read %s: %m", name);
msg = targetm.pch_valid_p (this_file_data, v.target_data_length);
free (this_file_data);
if (msg != NULL)
fd = open (name, O_RDONLY | O_BINARY, 0666);
if (fd == -1)
- fatal_error ("%s: couldn%'t open PCH file: %m", name);
+ fatal_error (input_location, "%s: couldn%'t open PCH file: %m", name);
if (c_common_valid_pch (pfile, name, fd) != 1)
{
if (!cpp_get_options (pfile)->warn_invalid_pch)
inform (input_location, "use -Winvalid-pch for more information");
- fatal_error ("%s: PCH file was invalid", name);
+ fatal_error (input_location, "%s: PCH file was invalid", name);
}
c_common_read_pch (pfile, name, fd, name);
case OPT_S:
case OPT_c:
- fatal_error ("%qs is not a valid option to the preprocessor",
+ fatal_error (input_location,
+ "%qs is not a valid option to the preprocessor",
decoded_options[i].orig_option_with_args_text);
return;
seen_input++;
if (seen_input == 3)
{
- fatal_error ("too many input files");
+ fatal_error (input_location, "too many input files");
return;
}
else if (seen_input == 2)
data = lto_get_section_data (file_data, LTO_section_function_body,
name, &len);
if (!data)
- fatal_error ("%s: section %s is missing",
+ fatal_error (input_location, "%s: section %s is missing",
file_data->file_name,
name);
int status;
if (!pex_get_status (pex, 1, &status))
- fatal_error ("can't get program status: %m");
+ fatal_error (input_location, "can't get program status: %m");
pex_free (pex);
if (status)
if (WIFSIGNALED (status))
{
int sig = WTERMSIG (status);
- fatal_error ("%s terminated with signal %d [%s]%s",
+ fatal_error (input_location, "%s terminated with signal %d [%s]%s",
prog, sig, strsignal (sig),
WCOREDUMP (status) ? ", core dumped" : "");
}
{
int ret = collect_wait (prog, pex);
if (ret != 0)
- fatal_error ("%s returned %d exit status", prog, ret);
+ fatal_error (input_location, "%s returned %d exit status", prog, ret);
if (response_file && !save_temps)
{
f = fopen (response_file, "w");
if (f == NULL)
- fatal_error ("could not open response file %s", response_file);
+ fatal_error (input_location, "could not open response file %s",
+ response_file);
status = writeargv (current_argv, f);
if (status)
- fatal_error ("could not write to response file %s", response_file);
+ fatal_error (input_location, "could not write to response file %s",
+ response_file);
status = fclose (f);
if (EOF == status)
- fatal_error ("could not close response file %s", response_file);
+ fatal_error (input_location, "could not close response file %s",
+ response_file);
response_arg = concat ("@", response_file, NULL);
response_argv[0] = argv0;
since we might not end up needing something that we could not find. */
if (argv[0] == 0)
- fatal_error ("cannot find '%s'", prog);
+ fatal_error (input_location, "cannot find '%s'", prog);
pex = pex_init (0, "collect2", NULL);
if (pex == NULL)
- fatal_error ("pex_init failed: %m");
+ fatal_error (input_location, "pex_init failed: %m");
errmsg = pex_run (pex, flags, argv[0], argv, outname,
errname, &err);
if (err != 0)
{
errno = err;
- fatal_error ("%s: %m", _(errmsg));
+ fatal_error (input_location, "%s: %m", _(errmsg));
}
else
- fatal_error (errmsg);
+ fatal_error (input_location, errmsg);
}
free (response_arg);
size_t num_files;
if (!lto_wrapper)
- fatal_error ("COLLECT_LTO_WRAPPER must be set");
+ fatal_error (input_location, "COLLECT_LTO_WRAPPER must be set");
num_lto_c_args++;
diagnostic_initialize (global_dc, 0);
if (atexit (collect_atexit) != 0)
- fatal_error ("atexit failed");
+ fatal_error (input_location, "atexit failed");
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
c_ptr = CONST_CAST2 (const char **, char **, c_argv);
if (argc < 2)
- fatal_error ("no arguments");
+ fatal_error (input_location, "no arguments");
#ifdef SIGQUIT
if (signal (SIGQUIT, SIG_IGN) != SIG_IGN)
stream = fopen (list_filename, "r");
if (stream == NULL)
- fatal_error ("can't open %s: %m", list_filename);
+ fatal_error (input_location, "can't open %s: %m",
+ list_filename);
while (fgets (buf, sizeof buf, stream) != NULL)
{
exportf = fopen (export_file, "w");
if (exportf == (FILE *) 0)
- fatal_error ("fopen %s: %m", export_file);
+ fatal_error (input_location, "fopen %s: %m", export_file);
write_aix_file (exportf, exports.first);
if (fclose (exportf))
- fatal_error ("fclose %s: %m", export_file);
+ fatal_error (input_location, "fclose %s: %m", export_file);
}
#endif
maybe_unlink (output_file);
outf = fopen (c_file, "w");
if (outf == (FILE *) 0)
- fatal_error ("fopen %s: %m", c_file);
+ fatal_error (input_location, "fopen %s: %m", c_file);
write_c_file (outf, c_file);
if (fclose (outf))
- fatal_error ("fclose %s: %m", c_file);
+ fatal_error (input_location, "fclose %s: %m", c_file);
/* Tell the linker that we have initializer and finalizer functions. */
#ifdef LD_INIT_SWITCH
#endif
exportf = fopen (export_file, "w");
if (exportf == (FILE *) 0)
- fatal_error ("fopen %s: %m", export_file);
+ fatal_error (input_location, "fopen %s: %m", export_file);
write_aix_file (exportf, exports.first);
if (fclose (exportf))
- fatal_error ("fclose %s: %m", export_file);
+ fatal_error (input_location, "fclose %s: %m", export_file);
}
#endif
/* If we do not have an `nm', complain. */
if (nm_file_name == 0)
- fatal_error ("cannot find 'nm'");
+ fatal_error (input_location, "cannot find 'nm'");
nm_argv[argc++] = nm_file_name;
if (NM_FLAGS[0] != '\0')
pex = pex_init (PEX_USE_PIPES, "collect2", NULL);
if (pex == NULL)
- fatal_error ("pex_init failed: %m");
+ fatal_error (input_location, "pex_init failed: %m");
errmsg = pex_run (pex, 0, nm_file_name, real_nm_argv, NULL, HOST_BIT_BUCKET,
&err);
if (err != 0)
{
errno = err;
- fatal_error ("%s: %m", _(errmsg));
+ fatal_error (input_location, "%s: %m", _(errmsg));
}
else
- fatal_error (errmsg);
+ fatal_error (input_location, errmsg);
}
int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN);
inf = pex_read_output (pex, 0);
if (inf == NULL)
- fatal_error ("can't open nm output: %m");
+ fatal_error (input_location, "can't open nm output: %m");
if (debug)
{
if (! (filter & SCAN_INIT))
break;
if (which_pass != PASS_LIB)
- fatal_error ("init function found in object %s", prog_name);
+ fatal_error (input_location, "init function found in object %s",
+ prog_name);
#ifndef LD_INIT_SWITCH
add_to_list (&constructors, name);
#endif
if (! (filter & SCAN_FINI))
break;
if (which_pass != PASS_LIB)
- fatal_error ("fini function found in object %s", prog_name);
+ fatal_error (input_location, "fini function found in object %s",
+ prog_name);
#ifndef LD_FINI_SWITCH
add_to_list (&destructors, name);
#endif
pex = pex_init (PEX_USE_PIPES, "collect2", NULL);
if (pex == NULL)
- fatal_error ("pex_init failed: %m");
+ fatal_error (input_location, "pex_init failed: %m");
errmsg = pex_run (pex, 0, ldd_file_name, real_ldd_argv, NULL, NULL, &err);
if (errmsg != NULL)
if (err != 0)
{
errno = err;
- fatal_error ("%s: %m", _(errmsg));
+ fatal_error (input_location, "%s: %m", _(errmsg));
}
else
- fatal_error (errmsg);
+ fatal_error (input_location, errmsg);
}
int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN);
inf = pex_read_output (pex, 0);
if (inf == NULL)
- fatal_error ("can't open ldd output: %m");
+ fatal_error (input_location, "can't open ldd output: %m");
if (debug)
notice ("\nldd output with constructors/destructors.\n");
name = p;
if (strncmp (name, "not found", sizeof ("not found") - 1) == 0)
- fatal_error ("dynamic dependency %s not found", buf);
+ fatal_error (input_location, "dynamic dependency %s not found", buf);
/* Find the end of the symbol name. */
for (end = p;
if (access (name, R_OK) == 0)
add_to_list (&libraries, name);
else
- fatal_error ("unable to open dynamic dependency '%s'", buf);
+ fatal_error (input_location, "unable to open dynamic dependency '%s'",
+ buf);
if (debug)
fprintf (stderr, "\t%s\n", buf);
if ((ldptr = ldopen (CONST_CAST (char *, prog_name), ldptr)) != NULL)
{
if (! MY_ISCOFF (HEADER (ldptr).f_magic))
- fatal_error ("%s: not a COFF file", prog_name);
+ fatal_error (input_location, "%s: not a COFF file", prog_name);
if (GCC_CHECK_HDR (ldptr))
{
}
else
{
- fatal_error ("%s: cannot open as COFF file", prog_name);
+ fatal_error (input_location, "%s: cannot open as COFF file",
+ prog_name);
}
#ifdef COLLECT_EXPORT_LIST
/* On AIX loop continues while there are more members in archive. */
if (debug)
fprintf (stderr, "not found\n");
else
- fatal_error ("library lib%s not found", name);
+ fatal_error (input_location, "library lib%s not found", name);
return (NULL);
}
#endif /* COLLECT_EXPORT_LIST */
if( UNSIGNED_INT6 (INTVAL (operands[opno])))
return true;
default:
- fatal_error("operand for sleep instruction must be an unsigned 6 bit compile-time constant");
+ fatal_error (input_location,
+ "operand for sleep instruction must be an unsigned 6 bit compile-time constant");
break;
}
return false;
cfun->machine->ccfsm_current_insn = NULL_RTX;
if (!INSN_ADDRESSES_SET_P())
- fatal_error ("Insn addresses not set after shorten_branches");
+ fatal_error (input_location, "Insn addresses not set after shorten_branches");
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
} while (changed);
if (INSN_ADDRESSES_SET_P())
- fatal_error ("insn addresses not freed");
+ fatal_error (input_location, "insn addresses not freed");
arc_reorg_in_progress = 0;
}
/* Keep this message in sync with the one in arc.c:arc_expand_builtin,
because *.md files do not get scanned by exgettext. */
- fatal_error (\"operand to trap_s should be an unsigned 6-bit value\");
+ fatal_error (input_location,
+ \"operand to trap_s should be an unsigned 6-bit value\");
}
[(set_attr "length" "2")
(set_attr "type" "misc")])
for (avr_current_device = avr_mcu_types; ; avr_current_device++)
{
if (!avr_current_device->name)
- fatal_error ("mcu not found");
+ fatal_error (input_location, "mcu not found");
if (!avr_current_device->macro
&& avr_current_device->arch == avr_arch_index)
break;
#define DEFAULT_PCC_STRUCT_RETURN 0
#define FUNCTION_PROFILER(file, labelno) \
- fatal_error ("profiling is not yet implemented for this architecture")
+ fatal_error (input_location, \
+ "profiling is not yet implemented for this architecture")
/* Trampolines. */
lto_asm_out_name = make_temp_file (".lto.s");
lto_asm_out_file = fopen (lto_asm_out_name, "a");
if (lto_asm_out_file == NULL)
- fatal_error ("failed to open temporary file %s for LTO output",
+ fatal_error (input_location,
+ "failed to open temporary file %s for LTO output",
lto_asm_out_name);
asm_out_file = lto_asm_out_file;
}
lto_asm_out_file = fopen (lto_asm_out_name, "r");
if (lto_asm_out_file == NULL)
- fatal_error ("failed to open temporary file %s with LTO output",
+ fatal_error (input_location,
+ "failed to open temporary file %s with LTO output",
lto_asm_out_name);
fseek (lto_asm_out_file, 0, SEEK_END);
n = ftell (lto_asm_out_file);
sz = (sz + pagesize - 1) / pagesize * pagesize;
if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
- fatal_error ("couldn%'t unmap pch_address_space: %m");
+ fatal_error (input_location, "couldn%'t unmap pch_address_space: %m");
if (ret)
{
off_t p = lseek(fd, 0, SEEK_CUR);
if (p == (off_t) -1)
- fatal_error ("can%'t get position in PCH file: %m");
+ fatal_error (input_location, "can%'t get position in PCH file: %m");
/* Cygwin requires that the underlying file be at least
as large as the requested mapping. */
if ((size_t) p < sz)
{
if ( ftruncate (fd, sz) == -1 )
- fatal_error ("can%'t extend PCH file: %m");
+ fatal_error (input_location, "can%'t extend PCH file: %m");
}
base = mmap (NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
munmap (base, sz);
if (lseek (fd, p, SEEK_SET) == (off_t) -1 )
- fatal_error ("can%'t set position in PCH file: %m");
+ fatal_error (input_location, "can%'t set position in PCH file: %m");
return base;
}
FILE *src_file = fopen (src_filename, "w");
if (!src_file)
- fatal_error ("cannot open '%s'", src_filename);
+ fatal_error (input_location, "cannot open '%s'", src_filename);
fprintf (src_file,
"extern void *__offload_funcs_end[];\n"
FILE *src_file = fopen (src_filename, "w");
if (!src_file)
- fatal_error ("cannot open '%s'", src_filename);
+ fatal_error (input_location, "cannot open '%s'", src_filename);
fprintf (src_file,
"void *__offload_funcs_end[0]\n"
FILE *src_file = fopen (src_filename, "w");
if (!src_file)
- fatal_error ("cannot open '%s'", src_filename);
+ fatal_error (input_location, "cannot open '%s'", src_filename);
fprintf (src_file,
"extern void *__OFFLOAD_TABLE__;\n"
obstack_ptr_grow (&argv_obstack, argv[i]);
}
if (!out_obj_filename)
- fatal_error ("output file not specified");
+ fatal_error (input_location, "output file not specified");
obstack_ptr_grow (&argv_obstack, opt2);
obstack_ptr_grow (&argv_obstack, "-o");
obstack_ptr_grow (&argv_obstack, target_so_filename);
diagnostic_initialize (global_dc, 0);
if (atexit (mkoffload_atexit) != 0)
- fatal_error ("atexit failed");
+ fatal_error (input_location, "atexit failed");
const char *host_compiler = getenv ("COLLECT_GCC");
if (!host_compiler)
- fatal_error ("COLLECT_GCC must be set");
+ fatal_error (input_location, "COLLECT_GCC must be set");
const char *target_driver_name
= DEFAULT_REAL_TARGET_MACHINE "-accel-" DEFAULT_TARGET_MACHINE "-gcc";
char *target_compiler = find_target_compiler (target_driver_name);
if (target_compiler == NULL)
- fatal_error ("offload compiler %s not found", target_driver_name);
+ fatal_error (input_location, "offload compiler %s not found",
+ target_driver_name);
/* We may be called with all the arguments stored in some file and
passed with @file. Expand them into argv before processing. */
if (strstr (argv[i], "ilp32"))
target_ilp32 = true;
else if (!strstr (argv[i], "lp64"))
- fatal_error ("unrecognizable argument of option -foffload-abi");
+ fatal_error (input_location,
+ "unrecognizable argument of option -foffload-abi");
break;
}
"-fno-math-errno is specified", N2FPU_NAME (i));
if (errors || custom_code_conflict)
- fatal_error ("conflicting use of -mcustom switches, target attributes, "
+ fatal_error (input_location,
+ "conflicting use of -mcustom switches, target attributes, "
"and/or __builtin_custom_ functions");
}
bool has_target_p = (dst_mode != VOIDmode);
if (N2FPU_N (code) < 0)
- fatal_error ("Cannot call %<__builtin_custom_%s%> without specifying switch"
+ fatal_error (input_location,
+ "Cannot call %<__builtin_custom_%s%> without specifying switch"
" %<-mcustom-%s%>", N2FPU_NAME (code), N2FPU_NAME (code));
if (has_target_p)
create_output_operand (&ops[opno++], target, dst_mode);
{
if (unlink_if_ordinary (file)
&& errno != ENOENT)
- fatal_error ("deleting file %s: %m", file);
+ fatal_error (input_location, "deleting file %s: %m", file);
}
else
fprintf (stderr, "[Leaving %s]\n", file);
{
const char *end = strchr (p1, '\n');
if (!end)
- fatal_error ("malformed ptx file");
+ fatal_error (input_location, "malformed ptx file");
id_map *v = XNEW (id_map);
size_t len = end - p1;
{
const char *collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
if (!collect_gcc_options)
- fatal_error ("environment variable COLLECT_GCC_OPTIONS must be set");
+ fatal_error (input_location,
+ "environment variable COLLECT_GCC_OPTIONS must be set");
struct obstack argv_obstack;
obstack_init (&argv_obstack);
char *collect_gcc = getenv ("COLLECT_GCC");
if (collect_gcc == NULL)
- fatal_error ("COLLECT_GCC must be set.");
+ fatal_error (input_location, "COLLECT_GCC must be set.");
const char *gcc_path = dirname (ASTRDUP (collect_gcc));
const char *gcc_exec = basename (ASTRDUP (collect_gcc));
in = fopen (ptx_name, "r");
if (!in)
- fatal_error ("cannot open intermediate ptx file");
+ fatal_error (input_location, "cannot open intermediate ptx file");
ptx_cfile_name = make_temp_file (".c");
out = fopen (ptx_cfile_name, "w");
if (!out)
- fatal_error ("cannot open '%s'", ptx_cfile_name);
+ fatal_error (input_location, "cannot open '%s'", ptx_cfile_name);
process (in, out);
fclose (out);
#define DEFAULT_PCC_STRUCT_RETURN 0
#define FUNCTION_PROFILER(file, labelno) \
- fatal_error ("profiling is not yet implemented for this architecture")
+ fatal_error (input_location, \
+ "profiling is not yet implemented for this architecture")
#define TRAMPOLINE_SIZE 32
#define TRAMPOLINE_ALIGNMENT 256
sigstk.ss_size = SIGSTKSZ;
sigstk.ss_flags = 0;
if (sigaltstack (&sigstk, NULL) < 0)
- fatal_error ("While setting up signal stack: %m");
+ fatal_error (input_location, "While setting up signal stack: %m");
sigemptyset(&sact.sa_mask);
sact.sa_flags = SA_ONSTACK | SA_SIGINFO;
sact.sa_sigaction = segv_handler;
if (sigaction (SIGSEGV, &sact, 0) < 0)
- fatal_error ("While setting up signal handler: %m");
+ fatal_error (input_location, "While setting up signal handler: %m");
}
\f
gcc_assert (IN_RANGE ((int)code, 0, (int)RS6000_BUILTIN_COUNT));
if (rs6000_builtin_decls[(int)code])
- fatal_error ("internal error: builtin function %s already processed", name);
+ fatal_error (input_location,
+ "internal error: builtin function %s already processed", name);
rs6000_builtin_decls[(int)code] = t =
add_builtin_function (name, type, (int)code, BUILT_IN_MD, NULL, NULL_TREE);
num_args--;
if (num_args == 0)
- fatal_error ("internal error: builtin function %s had no type", name);
+ fatal_error (input_location,
+ "internal error: builtin function %s had no type", name);
ret_type = builtin_mode_to_type[h.mode[0]][h.uns_p[0]];
if (!ret_type && h.uns_p[0])
ret_type = builtin_mode_to_type[h.mode[0]][0];
if (!ret_type)
- fatal_error ("internal error: builtin function %s had an unexpected "
+ fatal_error (input_location,
+ "internal error: builtin function %s had an unexpected "
"return type %s", name, GET_MODE_NAME (h.mode[0]));
for (i = 0; i < (int) ARRAY_SIZE (arg_type); i++)
arg_type[i] = builtin_mode_to_type[m][0];
if (!arg_type[i])
- fatal_error ("internal error: builtin function %s, argument %d "
+ fatal_error (input_location,
+ "internal error: builtin function %s, argument %d "
"had unexpected argument type %s", name, i,
GET_MODE_NAME (m));
}
cfun_frame_layout.frame_size = get_frame_size ();
if (!TARGET_64BIT && cfun_frame_layout.frame_size > 0x7fff0000)
- fatal_error ("total size of local variables exceeds architecture limit");
+ fatal_error (input_location,
+ "total size of local variables exceeds architecture limit");
if (!TARGET_PACKED_STACK)
{
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * class.c, except.c, parser.c, pt.c: All callers of fatal_error
+ changed to pass input_location as first argument.
+
2015-01-29 Jakub Jelinek <jakub@redhat.com>
PR c++/64717
}
}
if (!ok)
- fatal_error ("definition of std::initializer_list does not match "
+ fatal_error (input_location,
+ "definition of std::initializer_list does not match "
"#include <initializer_list>");
}
if (jthrow_node == NULL_TREE)
fatal_error
- ("call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined");
+ (input_location,
+ "call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined");
jthrow_node = TREE_TYPE (TREE_TYPE (jthrow_node));
static bool already_called = false;
if (already_called)
- fatal_error ("inter-module optimizations not implemented for C++");
+ fatal_error (input_location,
+ "inter-module optimizations not implemented for C++");
already_called = true;
the_parser = cp_parser_new ();
if (tinst_depth >= max_tinst_depth)
{
- fatal_error ("template instantiation depth exceeds maximum of %d"
+ fatal_error (input_location,
+ "template instantiation depth exceeds maximum of %d"
" (use -ftemplate-depth= to increase the maximum)",
max_tinst_depth);
return false;
{
tree decl = pending_templates->tinst->decl;
- fatal_error ("template instantiation depth exceeds maximum of %d"
+ fatal_error (input_location,
+ "template instantiation depth exceeds maximum of %d"
" instantiating %q+D, possibly from virtual table generation"
" (use -ftemplate-depth= to increase the maximum)",
max_tinst_depth, decl);
extern void error_n (location_t, int, const char *, const char *, ...)
ATTRIBUTE_GCC_DIAG(3,5) ATTRIBUTE_GCC_DIAG(4,5);
extern void error_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
- ATTRIBUTE_NORETURN;
extern void fatal_error (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3)
ATTRIBUTE_NORETURN;
/* Pass one of the OPT_W* from options.h as the second parameter. */
return errorcount || sorrycount;
}
-/* An error which is severe enough that we make no attempt to
- continue. Do not use this for internal consistency checks; that's
- internal_error. Use of this function should be rare. */
-void
-fatal_error (const char *gmsgid, ...)
-{
- diagnostic_info diagnostic;
- va_list ap;
-
- va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_FATAL);
- report_diagnostic (&diagnostic);
- va_end (ap);
-
- gcc_unreachable ();
-}
-
/* An error which is severe enough that we make no attempt to
continue. Do not use this for internal consistency checks; that's
internal_error. Use of this function should be rare. */
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * f95-lang.c, gfortranspec.c, trans-const.c, trans-expr.c: All
+ callers of fatal_error changed to pass input_location as first
+ argument.
+
2015-01-28 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (CO_BROADCAST): Correct argument description.
gfc_init_1 ();
if (!gfc_new_file ())
- fatal_error ("can't open input file: %s", gfc_source_file);
+ fatal_error (input_location, "can't open input file: %s", gfc_source_file);
if (flag_preprocess_only)
return false;
}
if (g77_newargc == newargsize)
- fatal_error ("overflowed output arg list for %qs",
+ fatal_error (input_location, "overflowed output arg list for %qs",
arg->orig_option_with_args_text);
g77_new_decoded_options[g77_newargc++] = *arg;
}
if ((n_outfiles != 0) && (n_infiles == 0))
- fatal_error ("no input files; unwilling to write output files");
+ fatal_error (input_location,
+ "no input files; unwilling to write output files");
/* If there are no input files, no need for the library. */
if (n_infiles == 0)
expr->representation.string);
default:
- fatal_error ("gfc_conv_constant_to_tree(): invalid type: %s",
+ fatal_error (input_location,
+ "gfc_conv_constant_to_tree(): invalid type: %s",
gfc_typename (&expr->ts));
}
}
gcc_unreachable ();
default:
- fatal_error ("Unknown intrinsic op");
+ fatal_error (input_location, "Unknown intrinsic op");
return;
}
p1++;
if (*p1++ != '<' || p[-2] != '>')
- fatal_error ("specs %%include syntax malformed after "
+ fatal_error (input_location,
+ "specs %%include syntax malformed after "
"%ld characters",
(long) (p1 - buffer + 1));
p1++;
if (*p1++ != '<' || p[-2] != '>')
- fatal_error ("specs %%include syntax malformed after "
+ fatal_error (input_location,
+ "specs %%include syntax malformed after "
"%ld characters",
(long) (p1 - buffer + 1));
p1++;
if (! ISALPHA ((unsigned char) *p1))
- fatal_error ("specs %%rename syntax malformed after "
+ fatal_error (input_location,
+ "specs %%rename syntax malformed after "
"%ld characters",
(long) (p1 - buffer));
p2++;
if (*p2 != ' ' && *p2 != '\t')
- fatal_error ("specs %%rename syntax malformed after "
+ fatal_error (input_location,
+ "specs %%rename syntax malformed after "
"%ld characters",
(long) (p2 - buffer));
p2++;
if (! ISALPHA ((unsigned char) *p2))
- fatal_error ("specs %%rename syntax malformed after "
+ fatal_error (input_location,
+ "specs %%rename syntax malformed after "
"%ld characters",
(long) (p2 - buffer));
p3++;
if (p3 != p - 1)
- fatal_error ("specs %%rename syntax malformed after "
+ fatal_error (input_location,
+ "specs %%rename syntax malformed after "
"%ld characters",
(long) (p3 - buffer));
*p3 = '\0';
break;
if (!sl)
- fatal_error ("specs %s spec was not found to be renamed", p1);
+ fatal_error (input_location,
+ "specs %s spec was not found to be renamed", p1);
if (strcmp (p1, p2) == 0)
continue;
for (newsl = specs; newsl; newsl = newsl->next)
if (strcmp (newsl->name, p2) == 0)
- fatal_error ("%s: attempt to rename spec %qs to "
+ fatal_error (input_location,
+ "%s: attempt to rename spec %qs to "
"already defined spec %qs",
filename, p1, p2);
continue;
}
else
- fatal_error ("specs unknown %% command after %ld characters",
+ fatal_error (input_location,
+ "specs unknown %% command after %ld characters",
(long) (p1 - buffer));
}
/* The colon shouldn't be missing. */
if (*p1 != ':')
- fatal_error ("specs file malformed after %ld characters",
+ fatal_error (input_location,
+ "specs file malformed after %ld characters",
(long) (p1 - buffer));
/* Skip back over trailing whitespace. */
/* Find the next line. */
p = skip_whitespace (p1 + 1);
if (p[1] == 0)
- fatal_error ("specs file malformed after %ld characters",
+ fatal_error (input_location,
+ "specs file malformed after %ld characters",
(long) (p - buffer));
p1 = p;
}
if (link_command_spec == 0)
- fatal_error ("spec file has no spec for linking");
+ fatal_error (input_location, "spec file has no spec for linking");
}
\f
/* Record the names of temporary files we tell compilers to write,
int require_machine_suffix, int os_multilib)
{
if (!IS_ABSOLUTE_PATH (prefix))
- fatal_error ("system path %qs is not absolute", prefix);
+ fatal_error (input_location, "system path %qs is not absolute", prefix);
if (target_system_root)
{
if (arg && strcmp (arg, "|") == 0)
{ /* each command. */
#if defined (__MSDOS__) || defined (OS2) || defined (VMS)
- fatal_error ("-pipe not supported");
+ fatal_error (input_location, "-pipe not supported");
#endif
argbuf[i] = 0; /* Termination of
command args. */
? PEX_RECORD_TIMES : 0),
progname, temp_filename);
if (pex == NULL)
- fatal_error ("pex_init failed: %m");
+ fatal_error (input_location, "pex_init failed: %m");
for (i = 0; i < n_commands; i++)
{
if (errmsg != NULL)
{
if (err == 0)
- fatal_error (errmsg);
+ fatal_error (input_location, errmsg);
else
{
errno = err;
statuses = (int *) alloca (n_commands * sizeof (int));
if (!pex_get_status (pex, n_commands, statuses))
- fatal_error ("failed to get exit status: %m");
+ fatal_error (input_location, "failed to get exit status: %m");
if (report_times || report_times_to_file)
{
times = (struct pex_time *) alloca (n_commands * sizeof (struct pex_time));
if (!pex_get_times (pex, n_commands, times))
- fatal_error ("failed to get process times: %m");
+ fatal_error (input_location, "failed to get process times: %m");
}
pex_free (pex);
}
if (!c)
- fatal_error ("GCC is not configured to support %s as offload target",
+ fatal_error (input_location,
+ "GCC is not configured to support %s as offload target",
target);
if (!offload_targets)
|| strcmp (arg, "object") == 0)
save_temps_flag = SAVE_TEMPS_OBJ;
else
- fatal_error ("%qs is an unknown -save-temps option",
+ fatal_error (input_location, "%qs is an unknown -save-temps option",
decoded->orig_option_with_args_text);
break;
for (i = 0; i < n_infiles; i++)
if ((!infiles[i].language || infiles[i].language[0] != '*')
&& canonical_filename_eq (infiles[i].name, output_file))
- fatal_error ("input file %qs is the same as output file",
+ fatal_error (input_location,
+ "input file %qs is the same as output file",
output_file);
}
/* Specs should only generate options, not input
files. */
if (strcmp (decoded_options[j].arg, "-") != 0)
- fatal_error ("switch %qs does not start with %<-%>",
+ fatal_error (input_location,
+ "switch %qs does not start with %<-%>",
decoded_options[j].arg);
else
- fatal_error ("spec-generated switch is just %<-%>");
+ fatal_error (input_location,
+ "spec-generated switch is just %<-%>");
break;
case OPT_fcompare_debug_second:
int status;
if (f == NULL)
- fatal_error ("could not open temporary response file %s",
+ fatal_error (input_location, "could not open temporary response file %s",
temp_file);
status = writeargv (argv, f);
if (status)
- fatal_error ("could not write to temporary response file %s",
+ fatal_error (input_location,
+ "could not write to temporary response file %s",
temp_file);
status = fclose (f);
if (EOF == status)
- fatal_error ("could not close temporary response file %s",
+ fatal_error (input_location, "could not close temporary response file %s",
temp_file);
store_arg (at_argument, 0, 0);
switch (c = *p++)
{
case 0:
- fatal_error ("spec %qs invalid", spec);
+ fatal_error (input_location, "spec %qs invalid", spec);
case 'b':
if (save_temps_length)
p += 2;
/* We don't support extra suffix characters after %O. */
if (*p == '.' || ISALNUM ((unsigned char) *p))
- fatal_error ("spec %qs has invalid %<%%0%c%>", spec, *p);
+ fatal_error (input_location,
+ "spec %qs has invalid %<%%0%c%>", spec, *p);
if (suffix_length == 0)
suffix = TARGET_OBJECT_SUFFIX;
else
unsigned int cur_index = argbuf.length ();
/* Handle the {...} following the %W. */
if (*p != '{')
- fatal_error ("spec %qs has invalid %<%%W%c%>", spec, *p);
+ fatal_error (input_location,
+ "spec %qs has invalid %<%%W%c%>", spec, *p);
p = handle_braces (p + 1);
if (p == 0)
return -1;
/* Skip past the option value and make a copy. */
if (*p != '{')
- fatal_error ("spec %qs has invalid %<%%x%c%>", spec, *p);
+ fatal_error (input_location,
+ "spec %qs has invalid %<%%x%c%>", spec, *p);
while (*p++ != '}')
;
string = save_string (p1 + 1, p - p1 - 2);
sf = lookup_spec_function (func);
if (sf == NULL)
- fatal_error ("unknown spec function %qs", func);
+ fatal_error (input_location, "unknown spec function %qs", func);
/* Push the spec processing context. */
save_argbuf = argbuf;
alloc_args ();
if (do_spec_2 (args) < 0)
- fatal_error ("error in args to spec function %qs", func);
+ fatal_error (input_location, "error in args to spec function %qs", func);
/* argbuf_index is an index for the next argument to be inserted, and
so contains the count of the args already inserted. */
break;
/* Only allow [A-Za-z0-9], -, and _ in function names. */
if (!ISALNUM (*endp) && !(*endp == '-' || *endp == '_'))
- fatal_error ("malformed spec function name");
+ fatal_error (input_location, "malformed spec function name");
}
if (*endp != '(') /* ) */
- fatal_error ("no arguments for spec function");
+ fatal_error (input_location, "no arguments for spec function");
func = save_string (p, endp - p);
p = ++endp;
}
/* ( */
if (*endp != ')')
- fatal_error ("malformed spec function arguments");
+ fatal_error (input_location, "malformed spec function arguments");
args = save_string (p, endp - p);
p = ++endp;
return p;
invalid:
- fatal_error ("braced spec %qs is invalid at %qc", orig, *p);
+ fatal_error (input_location, "braced spec %qs is invalid at %qc", orig, *p);
#undef SKIP_WHITE
}
return p;
invalid:
- fatal_error ("braced spec body %qs is invalid", body);
+ fatal_error (input_location, "braced spec body %qs is invalid", body);
}
\f
/* Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
pex = pex_init (PEX_USE_PIPES, new_argv[0], NULL);
if (!pex)
- fatal_error ("pex_init failed: %m");
+ fatal_error (input_location, "pex_init failed: %m");
errmsg = pex_run (pex, pex_flags, new_argv[0],
CONST_CAST2 (char *const *, const char **, &new_argv[1]), out_temp,
if (errmsg != NULL)
{
if (err == 0)
- fatal_error (errmsg);
+ fatal_error (input_location, errmsg);
else
{
errno = err;
#endif
if (atexit (delete_temp_files) != 0)
- fatal_error ("atexit failed");
+ fatal_error (input_location, "atexit failed");
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, fatal_signal);
else
/* The error status indicates that only one set of fixed
headers should be built. */
- fatal_error ("not configured with sysroot headers suffix");
+ fatal_error (input_location,
+ "not configured with sysroot headers suffix");
}
if (print_help_list)
int lang_n_infiles = 0;
if (n_infiles == added_libraries)
- fatal_error ("no input files");
+ fatal_error (input_location, "no input files");
if (seen_error ())
/* Early exit needed from main. */
}
if (!combine_inputs && have_c && have_o && lang_n_infiles > 1)
- fatal_error ("cannot specify -o with -c, -S or -E with multiple files");
+ fatal_error (input_location,
+ "cannot specify -o with -c, -S or -E with multiple files");
/* No early exit needed from main; we can continue. */
return false;
LTOPLUGINSONAME, R_OK,
false);
if (!temp_spec)
- fatal_error ("-fuse-linker-plugin, but %s not found",
+ fatal_error (input_location,
+ "-fuse-linker-plugin, but %s not found",
LTOPLUGINSONAME);
linker_plugin_file_spec = convert_white_space (temp_spec);
}
if (*q == '\0')
{
invalid_matches:
- fatal_error ("multilib spec %qs is invalid",
+ fatal_error (input_location, "multilib spec %qs is invalid",
multilib_matches);
}
q++;
if (*p == '\0')
{
invalid_exclusions:
- fatal_error ("multilib exclusions %qs is invalid",
+ fatal_error (input_location, "multilib exclusions %qs is invalid",
multilib_exclusions);
}
if (*p == '\0')
{
invalid_select:
- fatal_error ("multilib select %qs %qs is invalid",
+ fatal_error (input_location, "multilib select %qs %qs is invalid",
multilib_select, multilib_reuse);
}
++p;
if (*p == '\0')
{
invalid_select:
- fatal_error ("multilib select %qs is invalid", multilib_select);
+ fatal_error (input_location,
+ "multilib select %qs is invalid", multilib_select);
}
++p;
if (*e == '\0')
{
invalid_exclusion:
- fatal_error ("multilib exclusion %qs is invalid",
+ fatal_error (input_location,
+ "multilib exclusion %qs is invalid",
multilib_exclusions);
}
value = getenv (argv[0]);
if (!value)
- fatal_error ("environment variable %qs not defined", argv[0]);
+ fatal_error (input_location,
+ "environment variable %qs not defined", argv[0]);
/* We have to escape every character of the environment variable so
they are not interpreted as active spec characters. A
abort ();
rresult = regexec (&r, v1, 0, NULL, 0);
if (rresult == REG_NOMATCH)
- fatal_error ("invalid version number %qs", v1);
+ fatal_error (input_location, "invalid version number %qs", v1);
else if (rresult != 0)
abort ();
rresult = regexec (&r, v2, 0, NULL, 0);
if (rresult == REG_NOMATCH)
- fatal_error ("invalid version number %qs", v2);
+ fatal_error (input_location, "invalid version number %qs", v2);
else if (rresult != 0)
abort ();
bool result;
if (argc < 3)
- fatal_error ("too few arguments to %%:version-compare");
+ fatal_error (input_location, "too few arguments to %%:version-compare");
if (argv[0][0] == '\0')
abort ();
if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
nargs = 2;
if (argc != nargs + 3)
- fatal_error ("too many arguments to %%:version-compare");
+ fatal_error (input_location, "too many arguments to %%:version-compare");
switch_len = strlen (argv[nargs + 1]);
for (i = 0; i < n_switches; i++)
break;
default:
- fatal_error ("unknown operator %qs in %%:version-compare", argv[0]);
+ fatal_error (input_location,
+ "unknown operator %qs in %%:version-compare", argv[0]);
}
if (! result)
return NULL;
static char random_seed[HOST_BITS_PER_WIDE_INT / 4 + 3];
if (arg != 0)
- fatal_error ("too many arguments to %%:compare-debug-dump-opt");
+ fatal_error (input_location,
+ "too many arguments to %%:compare-debug-dump-opt");
do_spec_2 ("%{fdump-final-insns=*:%*}");
do_spec_1 (" ", 0, NULL);
const char **argv ATTRIBUTE_UNUSED)
{
if (arg != 0)
- fatal_error ("too many arguments to %%:compare-debug-self-opt");
+ fatal_error (input_location,
+ "too many arguments to %%:compare-debug-self-opt");
if (compare_debug >= 0)
return NULL;
int len;
if (arg == 0)
- fatal_error ("too few arguments to %%:compare-debug-auxbase-opt");
+ fatal_error (input_location,
+ "too few arguments to %%:compare-debug-auxbase-opt");
if (arg != 1)
- fatal_error ("too many arguments to %%:compare-debug-auxbase-opt");
+ fatal_error (input_location,
+ "too many arguments to %%:compare-debug-auxbase-opt");
if (compare_debug >= 0)
return NULL;
len = strlen (argv[0]);
if (len < 3 || strcmp (argv[0] + len - 3, ".gk") != 0)
- fatal_error ("argument to %%:compare-debug-auxbase-opt "
+ fatal_error (input_location, "argument to %%:compare-debug-auxbase-opt "
"does not end in .gk");
if (debug_auxbase_opt)
int i;
if (argc != 2)
- fatal_error ("too few arguments to %%:replace-extension");
+ fatal_error (input_location, "too few arguments to %%:replace-extension");
name = xstrdup (argv[0]);
#define gcov_nonruntime_assert(EXPR) ((void)(0 && (EXPR)))
#else
#define gcov_nonruntime_assert(EXPR) gcc_assert (EXPR)
-#define gcov_error(...) fatal_error (__VA_ARGS__)
+#define gcov_error(...) fatal_error (input_location, __VA_ARGS__)
#endif
/* File suffixes. */
ret = remove (name);
if (ret)
- fatal_error ("error in removing %s\n", name);
+ fatal_error (input_location, "error in removing %s\n", name);
return ret;
}
#else
if (mkdir (out) == -1 && errno != EEXIST)
#endif
- fatal_error ("Cannot make directory %s", out);
+ fatal_error (input_location, "Cannot make directory %s", out);
} else
unlink_profile_dir (out);
pwd = getcwd (NULL, 0);
if (pwd == NULL)
- fatal_error ("Cannot get current directory name");
+ fatal_error (input_location, "Cannot get current directory name");
ret = chdir (out);
if (ret)
- fatal_error ("Cannot change directory to %s", out);
+ fatal_error (input_location, "Cannot change directory to %s", out);
gcov_do_dump (profile, 0);
ret = chdir (pwd);
if (ret)
- fatal_error ("Cannot change directory to %s", pwd);
+ fatal_error (input_location, "Cannot change directory to %s", pwd);
free (pwd);
}
case 'w':
sscanf (optarg, "%d,%d", &w1, &w2);
if (w1 < 0 || w2 < 0)
- fatal_error ("weights need to be non-negative\n");
+ fatal_error (input_location, "weights need to be non-negative\n");
break;
default:
merge_usage ();
}
if (scale < 0.0)
- fatal_error ("scale needs to be non-negative\n");
+ fatal_error (input_location, "scale needs to be non-negative\n");
if (normalize_val != 0)
{
{
if (fwrite (&ptr, sizeof (void *), 1, state->f)
!= 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
}
else
{
saving_htab->find_with_hash (ptr, POINTER_HASH (ptr));
if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f)
!= 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
}
}
}
for (rt = gt_pch_scalar_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
if (fwrite (rti->base, rti->stride, 1, f) != 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
/* Write out all the global pointers, after translation. */
write_pch_globals (gt_ggc_rtab, &state);
long o;
o = ftell (state.f) + sizeof (mmi);
if (o == -1)
- fatal_error ("can%'t get position in PCH file: %m");
+ fatal_error (input_location, "can%'t get position in PCH file: %m");
mmi.offset = mmap_offset_alignment - o % mmap_offset_alignment;
if (mmi.offset == mmap_offset_alignment)
mmi.offset = 0;
mmi.offset += o;
}
if (fwrite (&mmi, sizeof (mmi), 1, state.f) != 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
if (mmi.offset != 0
&& fseek (state.f, mmi.offset, SEEK_SET) != 0)
- fatal_error ("can%'t write padding to PCH file: %m");
+ fatal_error (input_location, "can%'t write padding to PCH file: %m");
ggc_pch_prepare_write (state.d, state.f);
for (rt = gt_pch_scalar_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
if (fread (rti->base, rti->stride, 1, f) != 1)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
/* Read in all the global pointers, in 6 easy loops. */
for (rt = gt_ggc_rtab; *rt; rt++)
for (i = 0; i < rti->nelt; i++)
if (fread ((char *)rti->base + rti->stride * i,
sizeof (void *), 1, f) != 1)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
if (fread (&mmi, sizeof (mmi), 1, f) != 1)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
result = host_hooks.gt_pch_use_address (mmi.preferred_base, mmi.size,
fileno (f), mmi.offset);
if (result < 0)
- fatal_error ("had to relocate PCH");
+ fatal_error (input_location, "had to relocate PCH");
if (result == 0)
{
if (fseek (f, mmi.offset, SEEK_SET) != 0
|| fread (mmi.preferred_base, mmi.size, 1, f) != 1)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
}
else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
ggc_pch_read (f, mmi.preferred_base);
}
if (fwrite (x, size, 1, f) != 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
/* If SIZE is not the same as OBJECT_SIZE(order), then we need to pad the
object out to OBJECT_SIZE(order). This happens for strings. */
if (padding <= sizeof (emptyBytes))
{
if (fwrite (emptyBytes, 1, padding, f) != padding)
- fatal_error ("can%'t write PCH file");
+ fatal_error (input_location, "can%'t write PCH file");
}
else
{
/* Larger than our buffer? Just default to fseek. */
if (fseek (f, padding, SEEK_CUR) != 0)
- fatal_error ("can%'t write PCH file");
+ fatal_error (input_location, "can%'t write PCH file");
}
}
&& fseek (f, ROUND_UP_VALUE (d->d.totals[order] * OBJECT_SIZE (order),
G.pagesize),
SEEK_CUR) != 0)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
}
void
ggc_pch_finish (struct ggc_pch_data *d, FILE *f)
{
if (fwrite (&d->d, sizeof (d->d), 1, f) != 1)
- fatal_error ("can%'t write PCH file: %m");
+ fatal_error (input_location, "can%'t write PCH file: %m");
free (d);
}
/* Allocate the appropriate page-table entries for the pages read from
the PCH file. */
if (fread (&d, sizeof (d), 1, f) != 1)
- fatal_error ("can%'t read PCH file: %m");
+ fatal_error (input_location, "can%'t read PCH file: %m");
for (i = 0; i < NUM_ORDERS; i++)
{
fp = fopen (buf, mode);
if (fp == NULL)
- fatal_error ("can%'t open %s: %m", buf);
+ fatal_error (input_location, "can%'t open %s: %m", buf);
return fp;
}
/* Fatal error here. We do not want to support compiling ltrans units
with different version of compiler or different flags than the WPA
unit, so this should never happen. */
- fatal_error ("ipa inline summary is missing in input file");
+ fatal_error (input_location,
+ "ipa inline summary is missing in input file");
}
if (optimize)
{
/* Fatal error here. We do not want to support compiling ltrans units with
different version of compiler or different flags than the WPA unit, so
this should never happen. */
- fatal_error ("ipa reference summary is missing in ltrans unit");
+ fatal_error (input_location,
+ "ipa reference summary is missing in ltrans unit");
}
}
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * class.c, expr.c, jcf-parse.c, jvspec.c: All callers of
+ fatal_error changed to pass input_location as first argument.
+
2015-10-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* builtins.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h
= (const unsigned char *) IDENTIFIER_POINTER (method_sig);
if (sig[0] != '(')
- fatal_error ("bad method signature");
+ fatal_error (input_location, "bad method signature");
function_type = get_type_from_signature (method_sig);
fndecl = add_method_1 (this_class, access_flags, name, function_type);
if (method == meth)
break;
if (meth == NULL_TREE)
- fatal_error ("method '%s' not found in class",
+ fatal_error (input_location, "method '%s' not found in class",
IDENTIFIER_POINTER (DECL_NAME (method)));
method_index++;
}
load_class (self_type, 1);
safe_layout_class (self_type);
if (TREE_CODE (TYPE_SIZE (self_type)) == ERROR_MARK)
- fatal_error ("failed to find class '%s'", self_name);
+ fatal_error (input_location, "failed to find class '%s'", self_name);
}
layout_class_methods (self_type);
{
int char_len = UT8_CHAR_LENGTH (*utf8);
if (char_len < 0 || char_len > 3 || char_len > i)
- fatal_error ("bad string constant");
+ fatal_error (input_location, "bad string constant");
utf8 += char_len;
i -= char_len;
jcf->cpool.data[index].t = value;
return value;
bad:
- fatal_error ("bad value constant type %d, index %d",
+ fatal_error (input_location, "bad value constant type %d, index %d",
JPOOL_TAG (jcf, index), index);
}
bitmap_clear (field_offsets);
if (jcf_parse_preamble (jcf) != 0)
- fatal_error ("not a valid Java .class file");
+ fatal_error (input_location, "not a valid Java .class file");
code = jcf_parse_constant_pool (jcf);
if (code != 0)
- fatal_error ("error while parsing constant pool");
+ fatal_error (input_location, "error while parsing constant pool");
code = verify_constant_pool (jcf);
if (code > 0)
- fatal_error ("error in constant pool entry #%d\n", code);
+ fatal_error (input_location, "error in constant pool entry #%d\n", code);
jcf_parse_class (jcf);
if (main_class == NULL_TREE)
if (CLASS_PARSED_P (current_class))
{
/* FIXME - where was first time */
- fatal_error ("reading class %s for the second time from %s",
+ fatal_error (input_location,
+ "reading class %s for the second time from %s",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))),
jcf->filename);
}
code = jcf_parse_fields (jcf);
if (code != 0)
- fatal_error ("error while parsing fields");
+ fatal_error (input_location, "error while parsing fields");
code = jcf_parse_methods (jcf);
if (code != 0)
- fatal_error ("error while parsing methods");
+ fatal_error (input_location, "error while parsing methods");
code = jcf_parse_final_attributes (jcf);
if (code != 0)
- fatal_error ("error while parsing final attributes");
+ fatal_error (input_location, "error while parsing final attributes");
if (TYPE_REFLECTION_DATA (current_class))
annotation_write_byte (JV_DONE_ATTR);
int avail = 2000;
finput = fopen (main_input_filename, "r");
if (finput == NULL)
- fatal_error ("can%'t open %s: %m", LOCATION_FILE (input_location));
+ fatal_error (input_location,
+ "can%'t open %s: %m", LOCATION_FILE (input_location));
list = XNEWVEC (char, avail);
next = list;
for (;;)
if (count == 0)
{
if (! feof (finput))
- fatal_error ("error closing %s: %m",
+ fatal_error (input_location, "error closing %s: %m",
LOCATION_FILE (input_location));
*next = '\0';
break;
/* Close previous descriptor, if any */
if (finput && fclose (finput))
- fatal_error ("can%'t close input file %s: %m", main_input_filename);
+ fatal_error (input_location,
+ "can%'t close input file %s: %m", main_input_filename);
finput = fopen (filename, "rb");
if (finput == NULL)
- fatal_error ("can%'t open %s: %m", filename);
+ fatal_error (input_location, "can%'t open %s: %m", filename);
#ifdef IO_BUFFER_SIZE
setvbuf (finput, xmalloc (IO_BUFFER_SIZE),
linemap_add (line_table, LC_ENTER, false, filename, 0);
input_location = linemap_line_start (line_table, 0, 1);
if (open_in_zip (main_jcf, filename, NULL, 0) < 0)
- fatal_error ("bad zip/jar file %s", filename);
+ fatal_error (input_location, "bad zip/jar file %s", filename);
localToFile = SeenZipFiles;
/* Register all the classes defined there. */
process_zip_dir ((FILE *) main_jcf->read_state);
jcf->zipd = zdir;
if (read_zip_member (jcf, zdir, localToFile) < 0)
- fatal_error ("error while reading %s from zip file", file_name);
+ fatal_error (input_location,
+ "error while reading %s from zip file", file_name);
buffer = XNEWVEC (char, zdir->filename_length + 1 +
(jcf->buffer_end - jcf->buffer));
}
if (saw_D && ! main_class_name)
- fatal_error ("can%'t specify %<-D%> without %<--main%>");
+ fatal_error (input_location, "can%'t specify %<-D%> without %<--main%>");
if (main_class_name && ! verify_class_name (main_class_name))
- fatal_error ("%qs is not a valid class name", main_class_name);
+ fatal_error (input_location,
+ "%qs is not a valid class name", main_class_name);
num_args = argc + added;
if (saw_resource)
{
if (! saw_o)
- fatal_error ("--resource requires -o");
+ fatal_error (input_location, "--resource requires -o");
}
if (saw_C)
{
}
num_args += 2; /* For -o NONE. */
if (saw_o)
- fatal_error ("cannot specify both -C and -o");
+ fatal_error (input_location, "cannot specify both -C and -o");
}
if ((saw_o && java_files_count + class_files_count + zip_files_count > 1)
|| (saw_C && java_files_count > 1)
{
filelist_filename = make_temp_file ("jx");
if (filelist_filename == NULL)
- fatal_error ("cannot create temporary file");
+ fatal_error (input_location, "cannot create temporary file");
record_temp_file (filelist_filename, ! saw_save_temps, 0);
filelist_file = fopen (filelist_filename, "w");
if (filelist_file == NULL)
if (combine_inputs || indirect_files_count > 0)
num_args += 1; /* for "-ffilelist-file" */
if (combine_inputs && indirect_files_count > 0)
- fatal_error ("using both @FILE with multiple files not implemented");
+ fatal_error (input_location,
+ "using both @FILE with multiple files not implemented");
/* There's no point adding -shared-libgcc if we don't have a shared
libgcc. */
case OPT_fmain_:
if (! will_link)
- fatal_error ("cannot specify %<main%> class when not linking");
+ fatal_error (input_location,
+ "cannot specify %<main%> class when not linking");
--j;
continue;
}
node->lto_file_data->profile_info.runs);
node->count_materialization_scale = scale;
if (scale < 0)
- fatal_error ("Profile information in %s corrupted",
+ fatal_error (input_location, "Profile information in %s corrupted",
file_data->file_name);
if (scale == REG_BR_PROB_BASE)
ib = lto_create_simple_input_block (file_data, LTO_section_symtab_nodes,
&data, &len);
if (!ib)
- fatal_error ("cannot find LTO cgraph in %s", file_data->file_name);
+ fatal_error (input_location,
+ "cannot find LTO cgraph in %s", file_data->file_name);
input_profile_summary (ib, file_data);
file_data->symtab_node_encoder = lto_symtab_encoder_new (true);
nodes = input_cgraph_1 (file_data, ib);
ib = lto_create_simple_input_block (file_data, LTO_section_refs,
&data, &len);
if (!ib)
- fatal_error ("cannot find LTO section refs in %s",
+ fatal_error (input_location, "cannot find LTO section refs in %s",
file_data->file_name);
input_refs (ib, nodes);
lto_destroy_simple_input_block (file_data, LTO_section_refs,
vec_safe_push (offload_vars, var_decl);
}
else
- fatal_error ("invalid offload table in %s", file_data->file_name);
+ fatal_error (input_location,
+ "invalid offload table in %s", file_data->file_name);
tag = streamer_read_enum (ib, LTO_symtab_tags, LTO_symtab_last_tag);
}
void
lto_section_overrun (struct lto_input_block *ib)
{
- fatal_error ("bytecode stream: trying to read %d bytes "
+ fatal_error (input_location, "bytecode stream: trying to read %d bytes "
"after the end of the input buffer", ib->p - ib->len);
}
lto_value_range_error (const char *purpose, HOST_WIDE_INT val,
HOST_WIDE_INT min, HOST_WIDE_INT max)
{
- fatal_error ("%s out of range: Range is %i to %i, value is %i",
+ fatal_error (input_location,
+ "%s out of range: Range is %i to %i, value is %i",
purpose, (int)min, (int)max, (int)val);
}
for (cedge = node->callees; cedge; cedge = cedge->next_callee)
{
if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
- fatal_error ("Cgraph edge statement index out of range");
+ fatal_error (input_location,
+ "Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
if (!cedge->call_stmt)
- fatal_error ("Cgraph edge statement index not found");
+ fatal_error (input_location,
+ "Cgraph edge statement index not found");
}
for (cedge = node->indirect_calls; cedge; cedge = cedge->next_callee)
{
if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
- fatal_error ("Cgraph edge statement index out of range");
+ fatal_error (input_location,
+ "Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
if (!cedge->call_stmt)
- fatal_error ("Cgraph edge statement index not found");
+ fatal_error (input_location, "Cgraph edge statement index not found");
}
for (i = 0; node->iterate_reference (i, ref); i++)
if (ref->lto_stmt_uid)
{
if (gimple_stmt_max_uid (fn) < ref->lto_stmt_uid)
- fatal_error ("Reference statement index out of range");
+ fatal_error (input_location,
+ "Reference statement index out of range");
ref->stmt = stmts[ref->lto_stmt_uid - 1];
if (!ref->stmt)
- fatal_error ("Reference statement index not found");
+ fatal_error (input_location, "Reference statement index not found");
}
}
lto_check_version (int major, int minor)
{
if (major != LTO_major_version || minor != LTO_minor_version)
- fatal_error ("bytecode stream generated with LTO version %d.%d instead "
+ fatal_error (input_location,
+ "bytecode stream generated with LTO version %d.%d instead "
"of the expected %d.%d",
major, minor,
LTO_major_version, LTO_minor_version);
{
if (unlink_if_ordinary (file)
&& errno != ENOENT)
- fatal_error ("deleting LTRANS file %s: %m", file);
+ fatal_error (input_location, "deleting LTRANS file %s: %m", file);
}
else if (verbose)
fprintf (stderr, "[Leaving LTRANS %s]\n", file);
do
{
if (argv_storage[j] == '\0')
- fatal_error ("malformed COLLECT_GCC_OPTIONS");
+ fatal_error (input_location, "malformed COLLECT_GCC_OPTIONS");
else if (strncmp (&argv_storage[j], "'\\''", 4) == 0)
{
argv_storage[k++] = '\'';
if ((*decoded_options)[j].opt_index == foption->opt_index)
break;
if (j == *decoded_options_count)
- fatal_error ("Option %s not used consistently in all LTO input"
+ fatal_error (input_location,
+ "Option %s not used consistently in all LTO input"
" files", foption->orig_option_with_args_text);
break;
if (j == *decoded_options_count)
append_option (decoded_options, decoded_options_count, foption);
else if (foption->value != (*decoded_options)[j].value)
- fatal_error ("Option %s not used consistently in all LTO input"
+ fatal_error (input_location,
+ "Option %s not used consistently in all LTO input"
" files", foption->orig_option_with_args_text);
break;
compiler_opts, compiler_opt_count,
linker_opts, linker_opt_count);
if (!offload_names[i])
- fatal_error ("problem with building target image for %s\n", names[i]);
+ fatal_error (input_location,
+ "problem with building target image for %s\n", names[i]);
}
out:
{
size_t len = fread (buffer, 1, 512, s);
if (ferror (s) != 0)
- fatal_error ("reading input file");
+ fatal_error (input_location, "reading input file");
if (len > 0)
{
fwrite (buffer, 1, len, d);
if (ferror (d) != 0)
- fatal_error ("writing output file");
+ fatal_error (input_location, "writing output file");
}
}
}
char *tmp = xstrdup (paths[i]);
strcpy (paths[i] + len - strlen ("begin.o"), "end.o");
if (access_check (paths[i], R_OK) != 0)
- fatal_error ("installation error, can't find crtoffloadend.o");
+ fatal_error (input_location,
+ "installation error, can't find crtoffloadend.o");
/* The linker will delete the filenames we give it, so make
copies. */
offloadbegin = make_temp_file (".o");
break;
}
if (i == n_paths)
- fatal_error ("installation error, can't find crtoffloadbegin.o");
+ fatal_error (input_location,
+ "installation error, can't find crtoffloadbegin.o");
free_array_of_ptrs ((void **) paths, n_paths);
}
/* Get the driver and options. */
collect_gcc = getenv ("COLLECT_GCC");
if (!collect_gcc)
- fatal_error ("environment variable COLLECT_GCC must be set");
+ fatal_error (input_location,
+ "environment variable COLLECT_GCC must be set");
collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
if (!collect_gcc_options)
- fatal_error ("environment variable COLLECT_GCC_OPTIONS must be set");
+ fatal_error (input_location,
+ "environment variable COLLECT_GCC_OPTIONS must be set");
get_options_from_collect_gcc_options (collect_gcc, collect_gcc_options,
CL_LANG_ALL,
&decoded_options,
struct obstack env_obstack;
if (!stream)
- fatal_error ("fopen: %s: %m", ltrans_output_file);
+ fatal_error (input_location, "fopen: %s: %m", ltrans_output_file);
/* Parse the list of LTRANS inputs from the WPA stage. */
obstack_init (&env_obstack);
diagnostic_initialize (global_dc, 0);
if (atexit (lto_wrapper_cleanup) != 0)
- fatal_error ("atexit failed");
+ fatal_error (input_location, "atexit failed");
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, fatal_signal);
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error
+ changed to pass input_location as first argument.
+
2014-12-11 Jan Hubicka <hubicka@ucw.cz>
* lto-symtab.c (lto_varpool_replace_node): Merge TLS models.
if (errmsg != NULL)
{
if (err == 0)
- fatal_error ("%s", errmsg);
+ fatal_error (input_location, "%s", errmsg);
else
- fatal_error ("%s: %s", errmsg, xstrerror (err));
+ fatal_error (input_location, "%s: %s", errmsg, xstrerror (err));
}
simple_object_release_write (lo->sobj_w);
if (lo->fd != -1)
{
if (close (lo->fd) < 0)
- fatal_error ("close: %s", xstrerror (errno));
+ fatal_error (input_location, "close: %s", xstrerror (errno));
}
}
if (lo->section == NULL)
{
if (err == 0)
- fatal_error ("%s", errmsg);
+ fatal_error (input_location, "%s", errmsg);
else
- fatal_error ("%s: %s", errmsg, xstrerror (errno));
+ fatal_error (input_location, "%s: %s", errmsg, xstrerror (errno));
}
}
if (errmsg != NULL)
{
if (err == 0)
- fatal_error ("%s", errmsg);
+ fatal_error (input_location, "%s", errmsg);
else
- fatal_error ("%s: %s", errmsg, xstrerror (errno));
+ fatal_error (input_location, "%s: %s", errmsg, xstrerror (errno));
}
}
&& (e->resolution == LDPR_PREVAILING_DEF_IRONLY
|| e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
|| e->resolution == LDPR_PREVAILING_DEF))
- fatal_error ("multiple prevailing defs for %qE",
+ fatal_error (input_location, "multiple prevailing defs for %qE",
DECL_NAME (prevailing->decl));
return prevailing;
}
fd = open (file_data->file_name, O_RDONLY|O_BINARY);
if (fd == -1)
{
- fatal_error ("Cannot open %s", file_data->file_name);
+ fatal_error (input_location, "Cannot open %s", file_data->file_name);
return NULL;
}
fd_name = xstrdup (file_data->file_name);
fd, computed_offset);
if (result == MAP_FAILED)
{
- fatal_error ("Cannot map %s", file_data->file_name);
+ fatal_error (input_location, "Cannot map %s", file_data->file_name);
return NULL;
}
|| read (fd, result, len) != (ssize_t) len)
{
free (result);
- fatal_error ("Cannot read %s", file_data->file_name);
+ fatal_error (input_location, "Cannot read %s", file_data->file_name);
result = NULL;
}
#ifdef __MINGW32__
{
lto_file *file = lto_obj_file_open (temp_filename, true);
if (!file)
- fatal_error ("lto_obj_file_open() failed");
+ fatal_error (input_location, "lto_obj_file_open() failed");
lto_set_current_out_file (file);
ipa_write_optimization_summaries (encoder);
#endif
int w = waitpid (0, &status, WUNTRACED | WCONTINUED);
if (w == -1)
- fatal_error ("waitpid failed");
+ fatal_error (input_location, "waitpid failed");
if (WIFEXITED (status) && WEXITSTATUS (status))
- fatal_error ("streaming subprocess failed");
+ fatal_error (input_location, "streaming subprocess failed");
else if (WIFSIGNALED (status))
- fatal_error ("streaming subprocess was killed by signal");
+ fatal_error (input_location,
+ "streaming subprocess was killed by signal");
}
while (!WIFEXITED (status) && !WIFSIGNALED (status));
}
/* Open the LTRANS output list. */
if (!ltrans_output_list)
- fatal_error ("no LTRANS output list filename provided");
+ fatal_error (input_location, "no LTRANS output list filename provided");
timevar_push (TV_WHOPR_WPA);
}
ltrans_output_list_stream = fopen (ltrans_output_list, "w");
if (ltrans_output_list_stream == NULL)
- fatal_error ("opening LTRANS output list %s: %m", ltrans_output_list);
+ fatal_error (input_location,
+ "opening LTRANS output list %s: %m", ltrans_output_list);
for (i = 0; i < n_sets; i++)
{
unsigned int len = strlen (temp_filenames[i]);
if (fwrite (temp_filenames[i], 1, len, ltrans_output_list_stream) < len
|| fwrite ("\n", 1, 1, ltrans_output_list_stream) < 1)
- fatal_error ("writing to LTRANS output list %s: %m",
+ fatal_error (input_location, "writing to LTRANS output list %s: %m",
ltrans_output_list);
free (temp_filenames[i]);
}
/* Close the LTRANS output list. */
if (fclose (ltrans_output_list_stream))
- fatal_error ("closing LTRANS output list %s: %m", ltrans_output_list);
+ fatal_error (input_location,
+ "closing LTRANS output list %s: %m", ltrans_output_list);
free_ltrans_partitions();
free (temp_filename);
resolution = fopen (resolution_file_name, "r");
if (resolution == NULL)
- fatal_error ("could not open symbol resolution file: %m");
+ fatal_error (input_location,
+ "could not open symbol resolution file: %m");
t = fscanf (resolution, "%u", &num_objects);
gcc_assert (t == 1);
/* If there were errors during symbol merging bail out, we have no
good way to recover here. */
if (seen_error ())
- fatal_error ("errors during merging of translation units");
+ fatal_error (input_location,
+ "errors during merging of translation units");
/* Fixup all decls. */
lto_fixup_decls (all_file_decl_data);
char * const dumpname = concat (dump_base_name, ".decl", NULL);
gen_declaration_file = fopen (dumpname, "w");
if (gen_declaration_file == 0)
- fatal_error ("can%'t open %s: %m", dumpname);
+ fatal_error (input_location, "can%'t open %s: %m", dumpname);
free (dumpname);
}
impossible to get here. But it's good to have the check in
case the parser changes.
*/
- fatal_error ("method declaration not in @interface context");
+ fatal_error (input_location,
+ "method declaration not in @interface context");
}
if (flag_objc1_only && attributes)
/* definition_required */ false);
if (pp == proto)
- fatal_error ("protocol %qE has circular dependency",
+ fatal_error (input_location, "protocol %qE has circular dependency",
PROTOCOL_NAME (pp));
if (pp)
check_protocol_recursively (proto, PROTOCOL_LIST (pp));
{
struct rlimit rlim;
if (getrlimit (RLIMIT_CORE, &rlim) != 0)
- fatal_error ("getting core file size maximum limit: %m");
+ fatal_error (input_location, "getting core file size maximum limit: %m");
rlim.rlim_cur = rlim.rlim_max;
if (setrlimit (RLIMIT_CORE, &rlim) != 0)
- fatal_error ("setting core file size limit to maximum: %m");
+ fatal_error (input_location,
+ "setting core file size limit to maximum: %m");
}
#endif
diagnostic_abort_on_error (dc);
passes should never fail these checks, so we mention plugin in
the messages. */
if (!pass_info->pass)
- fatal_error ("plugin cannot register a missing pass");
+ fatal_error (input_location, "plugin cannot register a missing pass");
if (!pass_info->pass->name)
- fatal_error ("plugin cannot register an unnamed pass");
+ fatal_error (input_location, "plugin cannot register an unnamed pass");
if (!pass_info->reference_pass_name)
fatal_error
- ("plugin cannot register pass %qs without reference pass name",
+ (input_location,
+ "plugin cannot register pass %qs without reference pass name",
pass_info->pass->name);
/* Try to insert the new pass to the pass lists. We need to check
success |= position_pass (pass_info, &all_passes);
if (!success)
fatal_error
- ("pass %qs not found but is referenced by new pass %qs",
+ (input_location,
+ "pass %qs not found but is referenced by new pass %qs",
pass_info->reference_pass_name, pass_info->pass->name);
/* OK, we have successfully inserted the new pass. We need to register
plugin_name, ".so", NULL);
if (access (plugin_name, R_OK))
fatal_error
- ("inaccessible plugin file %s expanded from short plugin name %s: %m",
+ (input_location,
+ "inaccessible plugin file %s expanded from short plugin name %s: %m",
plugin_name, base_name);
}
else
/* Check the plugin license. */
if (dlsym (dl_handle, str_license) == NULL)
- fatal_error ("plugin %s is not licensed under a GPL-compatible license\n"
+ fatal_error (input_location,
+ "plugin %s is not licensed under a GPL-compatible license\n"
"%s", plugin->full_name, dlerror ());
PTR_UNION_AS_VOID_PTR (plugin_init_union) =
default_plugin_dir_name (void)
{
if (!plugindir_string)
- fatal_error ("-iplugindir <dir> option not passed from the gcc driver");
+ fatal_error (input_location,
+ "-iplugindir <dir> option not passed from the gcc driver");
return plugindir_string;
}
the new file name already exists. Therefore, we explicitly
remove the old file first. */
if (remove (f->key) == -1)
- fatal_error ("removing .rpo file: %m");
+ fatal_error (input_location, "removing .rpo file: %m");
if (rename (outname, f->key) == -1)
- fatal_error ("renaming .rpo file: %m");
+ fatal_error (input_location, "renaming .rpo file: %m");
if (!f->args)
{
|| !strcmp (asm_file_name, HOST_BIT_BUCKET))
asm_out_file = fopen (asm_file_name, "w");
else
- /* Use fatal_error (UNKOWN_LOCATION) instead of just fatal_error to
- prevent gcc from printing the first line in the current file. */
+ /* Use UNKOWN_LOCATION to prevent gcc from printing the first
+ line in the current file. */
fatal_error (UNKNOWN_LOCATION,
"input file %qs is the same as output file",
asm_file_name);
filename = concat (aux_base_name, ".", ext, NULL);
file = fopen (filename, "w");
if (!file)
- fatal_error ("can%'t open %s for writing: %m", filename);
+ fatal_error (input_location, "can%'t open %s for writing: %m", filename);
free (filename);
return file;
}
{
aux_info_file = fopen (aux_info_file_name, "w");
if (aux_info_file == 0)
- fatal_error ("can%'t open %s: %m", aux_info_file_name);
+ fatal_error (input_location, "can%'t open %s: %m", aux_info_file_name);
}
if (!targetm_common.have_named_sections)
if (asm_out_file)
{
if (ferror (asm_out_file) != 0)
- fatal_error ("error writing to %s: %m", asm_file_name);
+ fatal_error (input_location, "error writing to %s: %m", asm_file_name);
if (fclose (asm_out_file) != 0)
- fatal_error ("error closing %s: %m", asm_file_name);
+ fatal_error (input_location, "error closing %s: %m", asm_file_name);
}
if (stack_usage_file)
12);
if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (expr) >= END_BUILTINS)
- fatal_error ("machine independent builtin code out of range");
+ fatal_error (input_location,
+ "machine independent builtin code out of range");
else if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD)
{
tree result = targetm.builtin_decl (DECL_FUNCTION_CODE (expr), true);
if (!result || result == error_mark_node)
- fatal_error ("target specific builtin not available");
+ fatal_error (input_location,
+ "target specific builtin not available");
}
}
}
if (fclass == BUILT_IN_NORMAL)
{
if (fcode >= END_BUILTINS)
- fatal_error ("machine independent builtin code out of range");
+ fatal_error (input_location,
+ "machine independent builtin code out of range");
result = builtin_decl_explicit (fcode);
if (!result
&& fcode > BEGIN_CHKP_BUILTINS
{
result = targetm.builtin_decl (fcode, true);
if (!result || result == error_mark_node)
- fatal_error ("target specific builtin not available");
+ fatal_error (input_location, "target specific builtin not available");
}
else
gcc_unreachable ();
data = lto_get_section_data (file_data, LTO_section_function_body,
name, &len);
if (!data)
- fatal_error ("%s: section %s is missing",
+ fatal_error (input_location, "%s: section %s is missing",
file_data->file_name,
name);
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * plugin.cc: All callers of fatal_error changed to pass
+ input_location as first argument.
+
2015-01-09 Michael Collison <michael.collison@linaro.org>
* plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h,
errno = 0;
fd = strtol (plugin_info->argv[i].value, &tail, 0);
if (*tail != '\0' || errno != 0)
- fatal_error ("%s: invalid file descriptor argument to plugin",
+ fatal_error (input_location,
+ "%s: invalid file descriptor argument to plugin",
plugin_info->base_name);
break;
}
}
if (fd == -1)
- fatal_error ("%s: required plugin argument %<fd%> is missing",
+ fatal_error (input_location,
+ "%s: required plugin argument %<fd%> is missing",
plugin_info->base_name);
current_context = new plugin_context (fd);
cc1_plugin::protocol_int version;
if (!current_context->require ('H')
|| ! ::cc1_plugin::unmarshall (current_context, &version))
- fatal_error ("%s: handshake failed", plugin_info->base_name);
+ fatal_error (input_location,
+ "%s: handshake failed", plugin_info->base_name);
if (version != GCC_C_FE_VERSION_0)
- fatal_error ("%s: unknown version in handshake", plugin_info->base_name);
+ fatal_error (input_location,
+ "%s: unknown version in handshake", plugin_info->base_name);
register_callback (plugin_info->base_name, PLUGIN_PRAGMAS,
plugin_init_extra_pragmas, NULL);