int require_machine_suffix, int os_multilib)
{
if (!IS_ABSOLUTE_PATH (prefix))
- abort ();
+ fatal ("system path `%s' is not absolute", prefix);
if (target_system_root)
{
struct command *commands; /* each command buffer with above info. */
- if (processing_spec_function)
- abort ();
+ gcc_assert (!processing_spec_function);
/* Count # of piped commands. */
for (n_commands = 1, i = 0; i < argbuf_index; i++)
int pid;
pid = pwait (commands[i].pid, &status, 0);
- if (pid < 0)
- abort ();
+ gcc_assert (pid >= 0);
#ifdef HAVE_GETRUSAGE
if (report_times)
/* Each switch should start with '-'. */
if (argbuf[i][0] != '-')
- abort ();
+ fatal ("switch '%s' does not start with '-'", argbuf[i]);
sw = &switches[i + first];
sw->part1 = &argbuf[i][1];
switch (c = *p++)
{
case 0:
- fatal ("invalid specification! Bug in cc");
+ fatal ("spec '%s' invalid", spec);
case 'b':
obstack_grow (&obstack, input_basename, basename_length);
p += 2;
/* We don't support extra suffix characters after %O. */
if (*p == '.' || ISALPHA ((unsigned char) *p))
- abort ();
+ fatal ("spec '%s' has invalid `%%0%c'", spec, *p);
if (suffix_length == 0)
suffix = TARGET_OBJECT_SUFFIX;
else
int cur_index = argbuf_index;
/* Handle the {...} following the %W. */
if (*p != '{')
- abort ();
+ fatal ("spec `%s' 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 != '{')
- abort ();
+ fatal ("spec `%s' has invalid `%%x%c'", spec, *p);
while (*p++ != '}')
;
string = save_string (p1 + 1, p - p1 - 2);
{
const char *atom, *end_atom;
const char *d_atom = NULL, *d_end_atom = NULL;
+ const char *orig = p;
bool a_is_suffix;
bool a_is_starred;
do
{
if (a_must_be_last)
- abort ();
+ goto invalid;
/* Scan one "atom" (S in the description above of %{}, possibly
with !, ., or * modifiers). */
p++, a_is_starred = 1;
SKIP_WHITE();
- if (*p == '&' || *p == '}')
+ switch (*p)
{
+ case '&': case '}':
/* Substitute the switch(es) indicated by the current atom. */
ordered_set = true;
if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
|| atom == end_atom)
- abort ();
+ goto invalid;
mark_matching_switches (atom, end_atom, a_is_starred);
if (*p == '}')
process_marked_switches ();
- }
- else if (*p == '|' || *p == ':')
- {
+ break;
+
+ case '|': case ':':
/* Substitute some text if the current atom appears as a switch
or suffix. */
disjunct_set = true;
if (ordered_set)
- abort ();
+ goto invalid;
if (atom == end_atom)
{
if (!n_way_choice || disj_matched || *p == '|'
|| a_is_negated || a_is_suffix || a_is_starred)
- abort ();
+ goto invalid;
/* An empty term may appear as the last choice of an
N-way choice set; it means "otherwise". */
else
{
if (a_is_suffix && a_is_starred)
- abort ();
+ goto invalid;
if (!a_is_starred)
disj_starred = false;
d_atom = d_end_atom = NULL;
}
}
+ break;
+
+ default:
+ goto invalid;
}
- else
- abort ();
}
while (*p++ != '}');
return p;
-
+
+ invalid:
+ fatal ("braced spec `%s' is invalid at `%c'", orig, *p);
+
#undef SKIP_WHITE
}
else if (*p == '%' && p[1] == '*' && nesting_level == 1)
have_subst = true;
else if (*p == '\0')
- abort ();
+ goto invalid;
p++;
}
end_body--;
if (have_subst && !starred)
- abort ();
+ goto invalid;
if (matched)
{
}
return p;
+
+ invalid:
+ fatal ("braced spec body `%s' is invalid", body);
}
\f
/* Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
{
value = do_spec (input_file_compiler->spec);
infiles[i].preprocessed = true;
- if (have_o_argbuf_index)
- infiles[i].name = argbuf[have_o_argbuf_index];
- else
- abort ();
- infiles[i].incompiler = lookup_compiler (infiles[i].name,
- strlen (infiles[i].name),
- infiles[i].language);
+ if (!have_o_argbuf_index)
+ fatal ("spec `%s' is invalid", input_file_compiler->spec);
+ infiles[i].name = argbuf[have_o_argbuf_index];
+ infiles[i].incompiler
+ = lookup_compiler (infiles[i].name,
+ strlen (infiles[i].name),
+ infiles[i].language);
if (value < 0)
this_file_error = 1;
while (*q != ' ')
{
if (*q == '\0')
- abort ();
+ {
+ invalid_matches:
+ fatal ("multilib spec `%s' is invalid", multilib_matches);
+ }
q++;
}
matches[i].len = q - matches[i].str;
while (*q != ';' && *q != '\0')
{
if (*q == ' ')
- abort ();
+ goto invalid_matches;
q++;
}
matches[i].rep_len = q - matches[i].replace;
while (*p != ';')
{
if (*p == '\0')
- abort ();
+ {
+ invalid_exclusions:
+ fatal ("multilib exclusions `%s' is invalid",
+ multilib_exclusions);
+ }
if (! ok)
{
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
- abort ();
+ goto invalid_exclusions;
++p;
}
while (*p != ' ')
{
if (*p == '\0')
- abort ();
+ {
+ invalid_select:
+ fatal ("multilib select `%s' is invalid",
+ multilib_select);
+ }
++p;
}
this_path_len = p - this_path;
while (*p != ';')
{
if (*p == '\0')
- abort ();
+ goto invalid_select;
if (! ok)
{
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
- abort ();
+ goto invalid_select;
++p;
}
while (*p != ' ')
{
if (*p == '\0')
- abort ();
+ {
+ invalid_select:
+ fatal ("multilib select `%s' is invalid", multilib_select);
+ }
+
++p;
}
int mp = 0;
if (*e == '\0')
- abort ();
+ {
+ invalid_exclusion:
+ fatal ("multilib exclusion `%s' is invalid",
+ multilib_exclusions);
+ }
if (! m)
{
while (*e != ' ' && *e != ';')
{
if (*e == '\0')
- abort ();
+ goto invalid_exclusion;
++e;
}
int len = e - this_arg;
if (*q == '\0')
- abort ();
+ goto invalid_select;
arg = q;
while (*q != ' ' && *q != ';')
{
if (*q == '\0')
- abort ();
+ goto invalid_select;
++q;
}
- if (! strncmp (arg, this_arg, (len < q - arg) ? q - arg : len) ||
- default_arg (this_arg, e - this_arg))
+ if (! strncmp (arg, this_arg,
+ (len < q - arg) ? q - arg : len)
+ || default_arg (this_arg, e - this_arg))
{
mp = 1;
break;
if (! skip)
{
/* If this is a duplicate, skip it. */
- skip = (last_path != 0 && (unsigned int) (p - this_path) == last_path_len
+ skip = (last_path != 0
+ && (unsigned int) (p - this_path) == last_path_len
&& ! strncmp (last_path, this_path, last_path_len));
last_path = this_path;
const char *arg;
if (*q == '\0')
- abort ();
+ goto invalid_select;
if (*q == '!')
arg = NULL;
while (*q != ' ' && *q != ';')
{
if (*q == '\0')
- abort ();
+ goto invalid_select;
++q;
}
int use_arg;
if (*p == '\0')
- abort ();
+ goto invalid_select;
if (skip)
{
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
- abort ();
+ goto invalid_select;
if (use_arg)
putchar (*p);
++p;