public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: binutils@sourceware.org
Cc: nickc@redhat.com, jbeulich@suse.com
Subject: [PATCH v3 1/3] Revert "gas: drop scrubber states 14 and 15"
Date: Mon, 12 Aug 2024 08:12:49 -0700	[thread overview]
Message-ID: <20240812151251.2315001-2-hjl.tools@gmail.com> (raw)
In-Reply-To: <20240812151251.2315001-1-hjl.tools@gmail.com>

This reverts commit 7dd0dfbde7ee31167a3b2e192a575493d26b7b0a.

This is a prerequisite for the PR gas/32073 fix.
---
 gas/app.c             | 29 +++++++++++++++++++++++++++++
 gas/config/tc-ia64.h  |  3 +++
 gas/config/tc-tic6x.h |  2 ++
 3 files changed, 34 insertions(+)

diff --git a/gas/app.c b/gas/app.c
index a47276e4816..b88b4c96137 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -485,6 +485,12 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
 	 13: After seeing a vertical bar, looking for a second
 	     vertical bar as a parallel expression separator.
 #endif
+#ifdef TC_PREDICATE_START_CHAR
+	 14: After seeing a predicate start character at state 0, looking
+	     for a predicate end character as predicate.
+	 15: After seeing a predicate start character at state 1, looking
+	     for a predicate end character as predicate.
+#endif
 #ifdef TC_Z80
 	 16: After seeing an 'a' or an 'A' at the start of a symbol
 	 17: After seeing an 'f' or an 'F' in state 16
@@ -771,6 +777,29 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
       /* flushchar: */
       ch = GET ();
 
+#ifdef TC_PREDICATE_START_CHAR
+      if (ch == TC_PREDICATE_START_CHAR && (state == 0 || state == 1))
+	{
+	  state += 14;
+	  PUT (ch);
+	  continue;
+	}
+      else if (state == 14 || state == 15)
+	{
+	  if (ch == TC_PREDICATE_END_CHAR)
+	    {
+	      state -= 14;
+	      PUT (ch);
+	      ch = GET ();
+	    }
+	  else
+	    {
+	      PUT (ch);
+	      continue;
+	    }
+	}
+#endif
+
     recycle:
 
 #if defined TC_ARM && defined OBJ_ELF
diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h
index 665272adde3..8ab05373f6e 100644
--- a/gas/config/tc-ia64.h
+++ b/gas/config/tc-ia64.h
@@ -78,6 +78,9 @@ extern const char *ia64_target_format (void);
 #define LEX_QM		(LEX_NAME|LEX_BEGIN_NAME) /* allow `?' inside name */
 #define LEX_HASH	LEX_END_NAME	/* allow `#' ending a name */
 
+#define TC_PREDICATE_START_CHAR '('
+#define TC_PREDICATE_END_CHAR ')'
+
 extern const char ia64_symbol_chars[];
 #define tc_symbol_chars ia64_symbol_chars
 
diff --git a/gas/config/tc-tic6x.h b/gas/config/tc-tic6x.h
index f21673e2d36..0b4223961e9 100644
--- a/gas/config/tc-tic6x.h
+++ b/gas/config/tc-tic6x.h
@@ -24,6 +24,8 @@
 #define DOUBLEBAR_PARALLEL
 #define DWARF2_LINE_MIN_INSN_LENGTH 2
 #define MD_APPLY_SYM_VALUE(FIX) 0
+#define TC_PREDICATE_START_CHAR '['
+#define TC_PREDICATE_END_CHAR ']'
 /* For TI C6X, we keep spaces in what the preprocessor considers
    operands as they may separate functional unit specifiers from
    operands.  */
-- 
2.46.0


  reply	other threads:[~2024-08-12 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 15:12 [PATCH v3 0/3] Restore the original macro behaviors H.J. Lu
2024-08-12 15:12 ` H.J. Lu [this message]
2024-08-12 15:12 ` [PATCH v3 2/3] Revert "gas: have scrubber retain more whitespace" H.J. Lu
2024-08-12 15:12 ` [PATCH v3 3/3] gas: Add macro tests for PR gas/32073 H.J. Lu
2024-08-12 15:29   ` Jan Beulich
2024-08-12 15:35     ` H.J. Lu
2024-08-13  3:12       ` Alan Modra

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=20240812151251.2315001-2-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=nickc@redhat.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).