From: Jens Remus <jremus@linux.ibm.com>
To: binutils@sourceware.org
Cc: Jens Remus <jremus@linux.ibm.com>,
Andreas Krebbel <krebbel@linux.ibm.com>
Subject: [PATCH 01/14] s390: Lower severity of assembler syntax errors from fatal to error
Date: Thu, 15 Feb 2024 16:58:08 +0100 [thread overview]
Message-ID: <20240215155821.4065623-2-jremus@linux.ibm.com> (raw)
In-Reply-To: <20240215155821.4065623-1-jremus@linux.ibm.com>
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(-)
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
--
2.40.1
next prev parent reply other threads:[~2024-02-15 15:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 15:58 [PATCH 00/14] s390: Enhancements to working with addressing operands Jens Remus
2024-02-15 15:58 ` Jens Remus [this message]
2024-02-15 15:58 ` [PATCH 02/14] s390: Enhance handling of syntax errors in assembler Jens Remus
2024-02-15 15:58 ` [PATCH 03/14] s390: Do not erroneously use base operand value for length operand Jens Remus
2024-02-15 15:58 ` [PATCH 04/14] s390: Correct setting of highgprs flag in ELF output Jens Remus
2024-02-15 15:58 ` [PATCH 05/14] s390: Assemble processor specific test cases for their processor Jens Remus
2024-02-15 15:58 ` [PATCH 06/14] s390: Add comments to assembler operand parsing logic Jens Remus
2024-02-15 15:58 ` [PATCH 07/14] s390: Add test cases for base/index register 0 Jens Remus
2024-02-15 15:58 ` [PATCH 08/14] s390: Add test case for disassembler option warn-areg-zero Jens Remus
2024-02-15 15:58 ` [PATCH 09/14] s390: Revise s390-specific assembler option descriptions Jens Remus
2024-02-15 15:58 ` [PATCH 10/14] s390: Warn when register name type does not match operand Jens Remus
2024-02-15 15:58 ` [PATCH 11/14] s390: Print base register 0 as "0" in disassembly Jens Remus
2024-02-15 15:58 ` [PATCH 12/14] s390: Allow to explicitly omit base register operand in assembly Jens Remus
2024-02-15 15:58 ` [PATCH 13/14] s390: Provide operand number in assembler warning and error messages Jens Remus
2024-02-15 15:58 ` [PATCH 14/14] s390: Be more verbose about missing operand type Jens Remus
2024-03-01 12:24 ` [PATCH 00/14] s390: Enhancements to working with addressing operands Jens Remus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240215155821.4065623-2-jremus@linux.ibm.com \
--to=jremus@linux.ibm.com \
--cc=binutils@sourceware.org \
--cc=krebbel@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).