diff options
Diffstat (limited to 'gcc/gengenrtl.c')
-rw-r--r-- | gcc/gengenrtl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 762c96fa4e4..5a3211f64fe 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -242,7 +242,12 @@ gendef (f, format) /* See rtx_alloc in rtl.c for comments. */ fprintf (f, "{\n"); - fprintf (f, " rtx rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", + fprintf (f, " rtx rt;\n"); + fprintf (f, " if (ggc_p)\n"); + fprintf (f, " rt = ggc_alloc_rtx (%d);\n", + (int) strlen (format)); + fprintf (f, " else\n"); + fprintf (f, " rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", (int) strlen (format) - 1); fprintf (f, " PUT_CODE (rt, code);\n"); @@ -301,7 +306,8 @@ gencode (f) fputs ("#include \"config.h\"\n", f); fputs ("#include \"system.h\"\n", f); fputs ("#include \"obstack.h\"\n", f); - fputs ("#include \"rtl.h\"\n\n", f); + fputs ("#include \"rtl.h\"\n", f); + fputs ("#include \"ggc.h\"\n\n", f); fputs ("extern struct obstack *rtl_obstack;\n\n", f); fputs ("static rtx obstack_alloc_rtx PROTO((int length));\n", f); fputs ("static rtx obstack_alloc_rtx (length)\n", f); |