From ece5dcc1c00a48ecf63eae71983d04270cef4280 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 20 Feb 2017 12:06:52 +1030 Subject: [PATCH] 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. --- gas/ChangeLog | 7 +++++++ gas/NEWS | 4 ++-- gas/config/tc-ppc.c | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index a15f92e..9f7ce60 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2017-02-20 Alan Modra + + 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 * ecoff.c (ecoff_directive_ent, add_procedure): Handle `.aent'. diff --git a/gas/NEWS b/gas/NEWS index ef0780d..aee3852 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -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. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index fd5cc35..d52850c 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -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); } -- 2.7.4