[01/14] s390: Lower severity of assembler syntax errors from fatal to error

Message ID 20240215155821.4065623-2-jremus@linux.ibm.com
State Accepted
Headers
Series s390: Enhancements to working with addressing operands |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jens Remus Feb. 15, 2024, 3:58 p.m. UTC
  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 <krebbel@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
 gas/config/tc-s390.c                      | 12 ++++++------
 gas/testsuite/gas/s390/zarch-z9-109-err.l |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
  

Patch

diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 09a903aea2db..1b7935a848d0 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 1b06f93441a0..84d294de960a 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