Commit afe3d090 by Bernd Schmidt

Commit parts that were missing in Mark's last commit

From-SVN: r29164
parent 6bc2c8c8
...@@ -2393,6 +2393,7 @@ mark_eh_state (eh) ...@@ -2393,6 +2393,7 @@ mark_eh_state (eh)
struct eh_status *eh; struct eh_status *eh;
{ {
mark_eh_stack (&eh->x_ehstack); mark_eh_stack (&eh->x_ehstack);
mark_eh_stack (&eh->x_catchstack);
mark_eh_queue (&eh->x_ehqueue); mark_eh_queue (&eh->x_ehqueue);
ggc_mark_rtx (eh->x_catch_clauses); ggc_mark_rtx (eh->x_catch_clauses);
...@@ -2401,6 +2402,7 @@ mark_eh_state (eh) ...@@ -2401,6 +2402,7 @@ mark_eh_state (eh)
ggc_mark_tree (eh->x_protect_list); ggc_mark_tree (eh->x_protect_list);
ggc_mark_rtx (eh->ehc); ggc_mark_rtx (eh->ehc);
ggc_mark_rtx (eh->x_eh_return_stub_label);
} }
/* This group of functions initializes the exception handling data /* This group of functions initializes the exception handling data
......
...@@ -6714,6 +6714,7 @@ mark_function_state (p) ...@@ -6714,6 +6714,7 @@ mark_function_state (p)
} }
ggc_mark_rtx (p->x_nonlocal_goto_handler_slots); ggc_mark_rtx (p->x_nonlocal_goto_handler_slots);
ggc_mark_rtx (p->x_nonlocal_goto_handler_labels);
ggc_mark_rtx (p->x_nonlocal_goto_stack_level); ggc_mark_rtx (p->x_nonlocal_goto_stack_level);
ggc_mark_tree (p->x_nonlocal_labels); ggc_mark_tree (p->x_nonlocal_labels);
} }
......
...@@ -133,7 +133,7 @@ ggc_alloc_rtvec (nelt) ...@@ -133,7 +133,7 @@ ggc_alloc_rtvec (nelt)
int nelt; int nelt;
{ {
struct ggc_rtvec *v; struct ggc_rtvec *v;
int size = sizeof (*v) + (nelt - 1) * sizeof (rtunion); int size = sizeof (*v) + (nelt - 1) * sizeof (rtx);
v = (struct ggc_rtvec *) xmalloc (size); v = (struct ggc_rtvec *) xmalloc (size);
bzero ((char *) v, size); bzero ((char *) v, size);
...@@ -195,7 +195,7 @@ ggc_alloc_string (contents, length) ...@@ -195,7 +195,7 @@ ggc_alloc_string (contents, length)
strings = s; strings = s;
#ifdef GGC_DUMP #ifdef GGC_DUMP
fprintf(dump, "alloc string %p\n", &n->tree); fprintf(dump, "alloc string %p\n", &s->string);
#endif #endif
bytes_alloced_since_gc += size; bytes_alloced_since_gc += size;
......
...@@ -41,7 +41,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -41,7 +41,8 @@ Boston, MA 02111-1307, USA. */
#include "flags.h" #include "flags.h"
#include "output.h" #include "output.h"
#include "toplev.h" #include "toplev.h"
#include "ggc.h"
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <locale.h> #include <locale.h>
#endif #endif
...@@ -229,6 +230,16 @@ int objc_public_flag; ...@@ -229,6 +230,16 @@ int objc_public_flag;
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint PROTO ((FILE *, int, YYSTYPE)); extern void yyprint PROTO ((FILE *, int, YYSTYPE));
/* Add GC roots for variables local to this file. */
void
c_parse_init ()
{
ggc_add_tree_root (&declspec_stack, 1);
ggc_add_tree_root (&current_declspecs, 1);
ggc_add_tree_root (&prefix_attributes, 1);
}
%} %}
%% %%
......
...@@ -1493,6 +1493,25 @@ decl_name (decl, verbosity) ...@@ -1493,6 +1493,25 @@ decl_name (decl, verbosity)
return IDENTIFIER_POINTER (DECL_NAME (decl)); return IDENTIFIER_POINTER (DECL_NAME (decl));
} }
/* Mark P for GC. Also mark main_input_filename and input_filename. */
static void
mark_file_stack (p)
void *p;
{
struct file_stack *stack = *(struct file_stack **)p;
/* We're only called for input_file_stack, so we can mark the current
input_filename here as well. */
ggc_mark_string (main_input_filename);
ggc_mark_string (input_filename);
while (stack)
{
ggc_mark_string (stack->name);
stack = stack->next;
}
}
static int need_error_newline; static int need_error_newline;
/* Function of last error message; /* Function of last error message;
...@@ -3055,6 +3074,8 @@ compile_file (name) ...@@ -3055,6 +3074,8 @@ compile_file (name)
#endif #endif
} }
if (ggc_p)
name = ggc_alloc_string (name, strlen (name));
input_filename = name; input_filename = name;
/* Put an entry on the input file stack for the main input file. */ /* Put an entry on the input file stack for the main input file. */
...@@ -4772,6 +4793,9 @@ main (argc, argv) ...@@ -4772,6 +4793,9 @@ main (argc, argv)
flag_short_enums = DEFAULT_SHORT_ENUMS; flag_short_enums = DEFAULT_SHORT_ENUMS;
#endif #endif
ggc_add_root (&input_file_stack, 1, sizeof input_file_stack,
&mark_file_stack);
/* Perform language-specific options intialization. */ /* Perform language-specific options intialization. */
lang_init_options (); lang_init_options ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment