Downgrade powerpc register error to warning

PR 21118
	* NEWS: Revise powerpc register check.
	* config/tc-ppc.c (ppc_optimize_expr, md_assemble): Make "invalid
	register expression" a warning.
This commit is contained in:
Alan Modra 2017-02-20 12:06:52 +10:30
parent 99de87c36a
commit ece5dcc1c0
3 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2017-02-20 Alan Modra <amodra@gmail.com>
PR 21118
* NEWS: Revise powerpc register check.
* config/tc-ppc.c (ppc_optimize_expr, md_assemble): Make "invalid
register expression" a warning.
2017-02-17 Maciej W. Rozycki <macro@imgtec.com>
* ecoff.c (ecoff_directive_ent, add_procedure): Handle `.aent'.

View File

@ -1,8 +1,8 @@
-*- text -*-
* PowerPC gas now checks that the correct register class is used in
instructions. For instance, "addi %f4,%cr3,%r31" is now rejected
rather than silently producing "addi r4,r3,31".
instructions. For instance, "addi %f4,%cr3,%r31" warns three times
that the registers are invalid.
* Add support for the Texas Instruments PRU processor.

View File

@ -974,7 +974,7 @@ ppc_optimize_expr (expressionS *left, operatorT op, expressionS *right)
/* Accept reg +/- constant. */
if (left->X_op == O_register
&& !((op == O_add || op == O_subtract) && right->X_op == O_constant))
as_bad (_("invalid register expression"));
as_warn (_("invalid register expression"));
/* Accept constant + reg. */
if (right->X_op == O_register)
@ -982,7 +982,7 @@ ppc_optimize_expr (expressionS *left, operatorT op, expressionS *right)
if (op == O_add && left->X_op == O_constant)
left->X_md = right->X_md;
else
as_bad (_("invalid register expression"));
as_warn (_("invalid register expression"));
}
return 0;
@ -2976,7 +2976,7 @@ md_assemble (char *str)
&& !((ex.X_md & PPC_OPERAND_GPR) != 0
&& ex.X_add_number != 0
&& (operand->flags & PPC_OPERAND_GPR_0) != 0))
as_bad (_("invalid register expression"));
as_warn (_("invalid register expression"));
insn = ppc_insert_operand (insn, operand, ex.X_add_number & 0xff,
ppc_cpu, (char *) NULL, 0);
}