[binutils-gdb] PPC: ignore rest of line after earlier error

Jan Beulich jbeulich@sourceware.org
Fri Feb 27 07:03:48 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=12e1b1be1e34b76657d2048ac6b02b2e47b53c80

commit 12e1b1be1e34b76657d2048ac6b02b2e47b53c80
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Feb 27 07:59:39 2026 +0100

    PPC: ignore rest of line after earlier error
    
    If the operand parsing loop exits prematurely (due to an error), don't
    report a second error for the unparsed remainder.
    
    Reviewed-by: Peter Bergner <bergner@tenstorrent.com>

Diff:
---
 gas/config/tc-ppc.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 7ba6c1ffee8..396b0232816 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -3959,11 +3959,14 @@ md_assemble (char *str)
 	}
     }
 
-  while (is_whitespace (*str))
-    ++str;
+  if (*opindex_ptr == 0)
+    {
+      while (is_whitespace (*str))
+	++str;
 
-  if (*str != '\0')
-    as_bad (_("junk at end of line: `%s'"), str);
+      if (*str != '\0')
+	as_bad (_("junk at end of line: `%s'"), str);
+    }
 
 #ifdef OBJ_ELF
   /* Do we need/want an APUinfo section? */


More information about the Binutils-cvs mailing list