[v3,9/9] gas: drop scrubber states 14 and 15

Message ID 32cdb0b9-1ba8-44b7-8bc4-a8159bb863c1@suse.com
State New
Headers
Series gas: scrubber adjustments |

Commit Message

Jan Beulich July 31, 2024, 12:06 p.m. UTC
  While sadly 5262831592fb doesn't say anything on why these would have
been needed, the latest with the removal of most of the opcode vs
operands distinction in the scrubber these shouldn't be needed anymore.
The implementation was a little questionable anyway, in moving back to
states expecting labels, when clearly labels shouldn't really be
following predicates (in practice, due to another bug, at least ia64
permits such).
---
v3: New.
  

Comments

Andreas Schwab Aug. 11, 2024, 8:14 a.m. UTC | #1
This breaks gcc:

https://build.opensuse.org/package/live_build_log/devel:gcc:next/gcc15:cross-arm-none-gcc15-bootstrap/openSUSE_Tumbleweed/x86_64

/home/abuild/rpmbuild/BUILD/gcc-15.0.0+git2871/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-15.0.0+git2871/obj-x86_64-suse-linux/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include --sysroot=/usr/arm-suse-linux-gnueabi/sys-root   -g -O2 -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fno-inline -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include     -o _interwork_call_via_rX_s.o -MT _interwork_call_via_rX_s.o -MD -MP -MF _interwork_call_via_rX_s.dep -DSHARED -DL_interwork_call_via_rX -xassembler-with-cpp -c ../../../libgcc/config/arm/lib1funcs.S
../../../libgcc/config/arm/lib1funcs.S: Assembler messages:
../../../libgcc/config/arm/lib1funcs.S:200: Error: too many positional arguments
../../../libgcc/config/arm/lib1funcs.S:1978:  Info: macro invoked from here
../../../libgcc/config/arm/lib1funcs.S:2057: conditional infixes are deprecated in unified syntax
make[2]: *** [Makefile:498: _interwork_call_via_rX_s.o] Error 1
  
Andreas Schwab Aug. 11, 2024, 8:45 a.m. UTC | #2
Actually, it's the previous commit (gas: have scrubber retain more
whitespace) that broke this.
  
Jan Beulich Aug. 12, 2024, 7:48 a.m. UTC | #3
On 11.08.2024 10:45, Andreas Schwab wrote:
> Actually, it's the previous commit (gas: have scrubber retain more
> whitespace) that broke this.

Right, just that as with PR gas/32073 the issue is with the use of macros.
When I look at

97:	cfi_pop 97b - \unwind, 0xe, 0x0

I see (knowing that macro arguments don't need commas as separators) five
arguments, not three (as gas wrongly has been determining in the past).

For this case (when there are multiple arguments _and_ commas are used, a
heuristic (and transitional only) workaround may be possible to invent.
But really it's (like with the other regression reports) the source code
that needs fixing:

97:	(cfi_pop 97b - \unwind), 0xe, 0x0

or

97:	"cfi_pop 97b - \unwind", 0xe, 0x0

Jan
  

Patch

--- a/gas/app.c
+++ b/gas/app.c
@@ -490,12 +490,6 @@  do_scrub_chars (size_t (*get) (char *, s
 	 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
@@ -782,29 +776,6 @@  do_scrub_chars (size_t (*get) (char *, s
       /* 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
--- a/gas/config/tc-ia64.h
+++ b/gas/config/tc-ia64.h
@@ -78,9 +78,6 @@  extern const char *ia64_target_format (v
 #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
 
--- a/gas/config/tc-tic6x.h
+++ b/gas/config/tc-tic6x.h
@@ -24,8 +24,6 @@ 
 #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.  */