From: Jens Remus Date: Fri, 1 Mar 2024 11:45:14 +0000 (+0100) Subject: s390: Lower severity of assembler syntax errors from fatal to error X-Git-Tag: gdb-15-branchpoint~820 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5159682a61d4a874fb2428c7178f14da29ecedb7;p=thirdparty%2Fbinutils-gdb.git s390: Lower severity of assembler syntax errors from fatal to error Report s390 assembler syntax errors as error instead of fatal error. This allows the assembler to continue and potentially report further syntax errors in the source. This should not cause syntax errors to be erroneously accepted, as both error and fatal error cause the assembler to return with a non-zero return code. The following syntax errors are changed from fatal to error: - invalid length field specified - odd numbered general purpose register specified as register pair - invalid floating point register pair. Valid fp register pair operands are 0, 1, 4, 5, 8, 9, 12 or 13. gas/ * config/tc-s390.c: Lower severity of assembler syntax errors from fatal to error. * testsuite/gas/s390/zarch-z9-109-err.l: Likewise. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 09a903aea2d..1b7935a848d 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1346,7 +1346,7 @@ md_gather_operands (char *str, { if ((operand->flags & S390_OPERAND_LENGTH) && ex.X_op != O_constant) - as_fatal (_("invalid length field specified")); + as_bad (_("invalid length field specified")); if ((operand->flags & S390_OPERAND_INDEX) && ex.X_add_number == 0 && warn_areg_zero) @@ -1358,17 +1358,17 @@ md_gather_operands (char *str, if ((operand->flags & S390_OPERAND_GPR) && (operand->flags & S390_OPERAND_REG_PAIR) && (ex.X_add_number & 1)) - as_fatal (_("odd numbered general purpose register specified as " - "register pair")); + as_bad (_("odd numbered general purpose register specified as " + "register pair")); if ((operand->flags & S390_OPERAND_FPR) && (operand->flags & S390_OPERAND_REG_PAIR) && ex.X_add_number != 0 && ex.X_add_number != 1 && ex.X_add_number != 4 && ex.X_add_number != 5 && ex.X_add_number != 8 && ex.X_add_number != 9 && ex.X_add_number != 12 && ex.X_add_number != 13) - as_fatal (_("invalid floating point register pair. Valid fp " - "register pair operands are 0, 1, 4, 5, 8, 9, " - "12 or 13.")); + as_bad (_("invalid floating point register pair. Valid fp " + "register pair operands are 0, 1, 4, 5, 8, 9, " + "12 or 13.")); s390_insert_operand (insn, operand, ex.X_add_number, NULL, 0); } } diff --git a/gas/testsuite/gas/s390/zarch-z9-109-err.l b/gas/testsuite/gas/s390/zarch-z9-109-err.l index 1b06f93441a..84d294de960 100644 --- a/gas/testsuite/gas/s390/zarch-z9-109-err.l +++ b/gas/testsuite/gas/s390/zarch-z9-109-err.l @@ -1,2 +1,2 @@ .*: Assembler messages: -.*:3: Fatal error: odd numbered general purpose register specified as register pair +.*:3: Error: odd numbered general purpose register specified as register pair