This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch, gas] Change 'internal Error' to 'internal error'
On Wed, 2013-01-09 at 13:44 +1030, Alan Modra wrote:
> Since as_fatal prints "Fatal error: " before its argument, I'd be
> inclined to make these both as_fatal (_("can't hash %s: %s"), ...
> OK with that change.
Sounds good.
> I'd also get rid of all uses of internalError() in tc-mips.c and
> simply use abort(). See as.h definition of abort().
> I'll preapprove that change if you care to make it.
That seems reasonable. Here is the patch that I will check in shortly.
Steve Ellcey
sellcey@mips.com
2013-01-09 Steve Ellcey <sellcey@mips.com>
* config/tc-i386.c (md_begin): Remove 'internal Error' from as_fatal
calls.
* config/tc-mips.c (internalError): Remove, replace with abort.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index a0680d3..a74bfe6 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2375,7 +2375,7 @@ md_begin (void)
(void *) core_optab);
if (hash_err)
{
- as_fatal (_("internal Error: Can't hash %s: %s"),
+ as_fatal (_("can't hash %s: %s"),
(optab - 1)->name,
hash_err);
}
@@ -2397,7 +2397,7 @@ md_begin (void)
{
hash_err = hash_insert (reg_hash, regtab->reg_name, (void *) regtab);
if (hash_err)
- as_fatal (_("internal Error: Can't hash %s: %s"),
+ as_fatal (_("can't hash %s: %s"),
regtab->reg_name,
hash_err);
}
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 2d8639c..67f04aa 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1310,9 +1310,6 @@ static struct {
/* Prototypes for static functions. */
-#define internalError() \
- as_fatal (_("internal Error, line %d, %s"), __LINE__, __FILE__)
-
enum mips_regclass { MIPS_GR_REG, MIPS_FP_REG, MIPS16_REG };
static void append_insn
@@ -5030,7 +5027,7 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...)
continue;
default:
- internalError ();
+ abort ();
}
continue;
@@ -5234,12 +5231,12 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...)
break;
default:
- internalError ();
+ abort ();
}
continue;
default:
- internalError ();
+ abort ();
}
break;
}
@@ -10152,7 +10149,7 @@ mips16_macro (struct mips_cl_insn *ip)
switch (mask)
{
default:
- internalError ();
+ abort ();
case M_DDIV_3:
dbl = 1;
@@ -11300,7 +11297,7 @@ mips_ip (char *str, struct mips_cl_insn *ip)
while (imm->type && imm->type != *args)
++imm;
if (! imm->type)
- internalError ();
+ abort ();
my_getExpression (&imm_expr, s);
check_absolute_expr (ip, &imm_expr);
if ((unsigned long) imm_expr.X_add_number & ~imm->mask)
@@ -12835,7 +12832,7 @@ mips_ip (char *str, struct mips_cl_insn *ip)
break;
default:
- internalError ();
+ abort ();
}
if (regno == ILLEGAL_REG)
@@ -12908,7 +12905,7 @@ mips_ip (char *str, struct mips_cl_insn *ip)
break;
default:
- internalError ();
+ abort ();
}
continue;
@@ -13372,7 +13369,7 @@ mips_ip (char *str, struct mips_cl_insn *ip)
default:
as_bad (_("Bad char = '%c'\n"), *args);
- internalError ();
+ abort ();
}
break;
}
@@ -13649,7 +13646,7 @@ mips16_ip (char *str, struct mips_cl_insn *ip)
break;
default:
- internalError ();
+ abort ();
}
if (regno == ILLEGAL_REG)
@@ -13682,7 +13679,7 @@ mips16_ip (char *str, struct mips_cl_insn *ip)
MIPS16_INSERT_OPERAND (REG32R, *ip, regno);
break;
default:
- internalError ();
+ abort ();
}
lastregno = regno;
@@ -14041,7 +14038,7 @@ mips16_ip (char *str, struct mips_cl_insn *ip)
continue;
default:
- internalError ();
+ abort ();
}
break;
}
@@ -15852,7 +15849,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
break;
default:
- internalError ();
+ abort ();
}
/* Remember value for tc_gen_reloc. */