]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
genemit: Remove support for string operands
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 May 2025 09:01:31 +0000 (10:01 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 May 2025 09:01:31 +0000 (10:01 +0100)
gen_exp currently supports the 's' (string) operand type.  It would
certainly be possible to make the upcoming bytecode patch support
that too.  However, the rtx codes that have string operands should
be very rarely used in hard-coded define_insn/expand/split/peephole2
rtx templates (as opposed to things like attribute expressions,
where const_string is commonplace).  And AFAICT, no current target
does use them like that.

This patch therefore reports an error for these rtx codes,
rather than adding code that would be unused and untested.

gcc/
* genemit.cc (generator::gen_exp): Report an error for 's' operands.

gcc/genemit.cc

index 9923cf078b96ea2660b3e9c0a0706a5e9ccdd8df..ba64290af53eda93c9282d99c200fa4671f1cf54 100644 (file)
@@ -270,6 +270,7 @@ generator::gen_exp (rtx x)
          break;
 
        case 'L':
+       case 's':
          fatal_at (info.loc, "'%s' rtxes are not supported in this context",
                    GET_RTX_NAME (code));
          break;
@@ -284,10 +285,6 @@ generator::gen_exp (rtx x)
          fprintf (file, "%d", SUBREG_BYTE (x).to_constant ());
          break;
 
-       case 's':
-         fprintf (file, "\"%s\"", XSTR (x, i));
-         break;
-
        case 'E':
          {
            int j;