This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Some syntactic sugar for machine descriptions
- To: Richard dot Earnshaw at arm dot com
- Subject: Re: Some syntactic sugar for machine descriptions
- From: "Zack Weinberg" <zackw at Stanford dot EDU>
- Date: Mon, 2 Jul 2001 08:04:14 -0700
- Cc: gcc-patches at gcc dot gnu dot org
On Mon, Jul 02, 2001 at 12:00:29PM +0100, Richard Earnshaw wrote:
>
> This patch is breaking the ARM compiler. Specifically, it's missing code
> to handle format 'T' in
>
> print-rtl.c: print_rtx()
> gensupport.c: collect_insn_data ()
> rtl.c: copy_rtx ()
Sorry. Please try this patch. I've successfully built an i386->arm
cross compiler with it.
--
zw I was putting away groceries in our kitchen when I got to the
cabbages and thought "this needs to be tossed into air, preferably
without looking up first."
-- James Nicoll
* rtl.c (copy_rtx): Handle 'T' format letter.
* gensupport.c (collect_insn_data): Likewise.
* print-rtl.c (print_rtx): Print 'T' slots like 's'.
===================================================================
Index: rtl.c
--- rtl.c 2001/06/30 17:23:52 1.92
+++ rtl.c 2001/07/02 15:02:43
@@ -420,6 +420,7 @@ copy_rtx (orig)
case 'i':
case 's':
case 'S':
+ case 'T':
case 'u':
case '0':
/* These are left unchanged. */
===================================================================
Index: gensupport.c
--- gensupport.c 2001/03/10 04:20:02 1.14
+++ gensupport.c 2001/07/02 15:02:43
@@ -453,7 +453,7 @@ collect_insn_data (pattern, palt, pmax)
collect_insn_data (XVECEXP (pattern, i, j), palt, pmax);
break;
- case 'i': case 'w': case '0': case 's': case 'S':
+ case 'i': case 'w': case '0': case 's': case 'S': case 'T':
break;
default:
===================================================================
Index: print-rtl.c
--- print-rtl.c 2001/06/05 20:32:40 1.66
+++ print-rtl.c 2001/07/02 15:02:43
@@ -163,19 +163,29 @@ print_rtx (in_rtx)
for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
switch (*format_ptr++)
{
- case 'S':
- case 's':
- if (XSTR (in_rtx, i) == 0)
- fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
- else
- {
- if (dump_for_graph)
- fprintf (outfile, " (\\\"%s\\\")", XSTR (in_rtx, i));
- else
- fprintf (outfile, " (\"%s\")", XSTR (in_rtx, i));
- }
- sawclose = 1;
- break;
+ {
+ const char *str;
+ case 'T':
+ str = XTMPL (in_rtx, i);
+ goto string;
+
+ case 'S':
+ case 's':
+ str = XSTR (in_rtx, i);
+ string:
+
+ if (str == 0)
+ fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
+ else
+ {
+ if (dump_for_graph)
+ fprintf (outfile, " (\\\"%s\\\")", str);
+ else
+ fprintf (outfile, " (\"%s\")", str);
+ }
+ sawclose = 1;
+ break;
+ }
/* 0 indicates a field for internal use that should not be printed.
An exception is the third field of a NOTE, where it indicates