This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PCH] Remove 'really' GTY modifier
- From: Geoffrey Keating <geoffk at romulus dot sfbay dot redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 May 2002 10:21:57 -0700
- Subject: [PCH] Remove 'really' GTY modifier
The 'really' modifier was a hack I put in that I now no longer need,
so here it goes.
Bootstrapped & tested on i686-pc-linux-gnu and built on
powerpc-eabisim, both with GC checking.
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/pchbranch-noreally.patch==================
Index: ChangeLog
2002-05-03 Geoffrey Keating <geoffk@redhat.com>
* config/xtensa/t-xtensa: Add dependencies for gt-xtensa.h.
* config/xtensa/xtensa.c: Include gt-cris.h.
(struct machine_function): Use gengtype to mark.
* config/mmix/mmix.h (struct machine_function): Use gengtype
to mark.
* config/cris/t-cris: Add dependencies for gt-cris.h.
* config/cris/cris.c: Include gt-cris.h.
(struct machine_function): Use gengtype to mark.
* config/rs6000/rs6000.h (struct machine_function): Use gengtype
to mark.
* doc/tm.texi (Per-Function Data): Delete references to
mark_machine_status.
* config/ia64/ia64.c (ia64_override_options): Don't set
mark_machine_status.
* config/i386/i386.c (override_options): Likewise.
* config/d30v/d30v.c (d30v_init_expanders): Likewise.
* config/arm/arm.c (arm_init_expanders): Likewise.
* config/alpha/alpha.c (override_options): Likewise.
* gengtype.h (enum gc_used_enum): Add GC_MAYBE_POINTED_TO.
* gengtype.c (set_gc_used_type): Handle 'maybe_null' option.
(write_gc_structure_fields): Don't handle 'really' option.
Handle 'maybe_null' option.
(write_gc_types): Handle 'maybe_null' option.
* function.h (struct function): Don't use "really".
(mark_machine_status): Delete declaration.
(mark_lang_status): Delete declaration.
(gt_ggc_mr_machine_function): Delete prototype.
(gt_ggc_mr_language_function): Delete prototype.
* function.c (mark_machine_status): Delete.
(mark_lang_status): Delete.
(gt_ggc_mr_machine_function): Delete.
(gt_ggc_mr_language_function): Delete.
* c-tree.h (mark_c_function_context): Delete prototype.
* c-objc-common.c (c_objc_common_init): Don't set mark_lang_status.
* c-decl.c (struct language_function): Rename from struct
c_language_function. Update uses. Use gengtype to mark.
(mark_c_function_context): Delete.
* c-common.h (struct c_language_function): Rename from struct
language_function.
(mark_stmt_tree): Delete prototype.
(c_mark_lang_decl): Delete prototype.
(mark_c_language_function): Delete prototype.
* c-common.c (mark_stmt_tree): Delete.
(c_mark_lang_decl): Delete.
(mark_c_language_function): Delete.
Index: ada/ChangeLog
2002-05-03 Geoffrey Keating <geoffk@redhat.com>
* utils.c (struct language_function): New dummy structure.
Index: cp/ChangeLog
2002-05-03 Geoffrey Keating <geoffk@redhat.com>
* semantics.c (current_stmt_tree): Update for change to
struct language_function.
(finish_mem_initializers): Likewise.
* decl.c (cxx_init_decl_processing): Don't set mark_lang_status.
* cp-tree.h (struct language_function): Rename from
cp_language_function. Change all uses.
(cp_function_chain): Don't need to cast.
Index: f/ChangeLog
2002-05-03 Geoffrey Keating <geoffk@redhat.com>
* com.c (struct language_function): New dummy structure.
Index: java/ChangeLog
2002-05-03 Geoffrey Keating <geoffk@redhat.com>
* lang.c (struct language_function): New dummy structure.
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.286.4.4
diff -p -u -p -r1.286.4.4 c-common.c
--- c-common.c 6 Apr 2002 00:08:43 -0000 1.286.4.4
+++ c-common.c 4 May 2002 03:26:25 -0000
@@ -3522,42 +3522,6 @@ finish_label_address_expr (label)
return result;
}
-/* Mark P (a stmt_tree) for GC. The use of a `void *' for the
- parameter allows this function to be used as a GC-marking
- function. */
-
-void
-mark_stmt_tree (p)
- void *p;
-{
- stmt_tree st = (stmt_tree) p;
-
- ggc_mark_tree (st->x_last_stmt);
- ggc_mark_tree (st->x_last_expr_type);
-}
-
-/* Mark LD for GC. */
-
-void
-c_mark_lang_decl (c)
- struct c_lang_decl *c ATTRIBUTE_UNUSED;
-{
-}
-
-/* Mark F for GC. */
-
-void
-mark_c_language_function (f)
- struct language_function *f;
-{
- if (!f)
- return;
-
- ggc_mark (f);
- mark_stmt_tree (&f->x_stmt_tree);
- ggc_mark_tree (f->x_scope_stmt_stack);
-}
-
/* Hook used by expand_expr to expand language-specific tree codes. */
rtx
Index: c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.112.4.5
diff -p -u -p -r1.112.4.5 c-common.h
--- c-common.h 27 Apr 2002 19:39:34 -0000 1.112.4.5
+++ c-common.h 4 May 2002 03:26:25 -0000
@@ -281,7 +281,7 @@ typedef struct stmt_tree_s *stmt_tree;
/* Global state pertinent to the current function. Some C dialects
extend this structure with additional fields. */
-struct language_function GTY(()) {
+struct c_language_function GTY(()) {
/* While we are parsing the function, this contains information
about the statement-tree that we are building. */
struct stmt_tree_s x_stmt_tree;
@@ -340,7 +340,6 @@ extern tree walk_stmt_tree PARAMS ((tr
void *));
extern void prep_stmt PARAMS ((tree));
extern void expand_stmt PARAMS ((tree));
-extern void mark_stmt_tree PARAMS ((void *));
extern void shadow_warning PARAMS ((const char *,
tree, tree));
extern tree c_begin_if_stmt PARAMS ((void));
@@ -364,8 +363,6 @@ struct c_lang_decl GTY(()) {
#define DECL_NUM_STMTS(NODE) \
(FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
-extern void c_mark_lang_decl PARAMS ((struct c_lang_decl *));
-
/* The variant of the C language being processed. Each C language
front-end defines this variable. */
@@ -812,8 +809,6 @@ extern tree boolean_increment PARAMS (
/* Hook currently used only by the C++ front end to reset internal state
after entering or leaving a header file. */
extern void extract_interface_info PARAMS ((void));
-
-extern void mark_c_language_function PARAMS ((struct language_function *));
extern int case_compare PARAMS ((splay_tree_key,
splay_tree_key));
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.288.2.8
diff -p -u -p -r1.288.2.8 c-decl.c
--- c-decl.c 27 Apr 2002 19:39:35 -0000 1.288.2.8
+++ c-decl.c 4 May 2002 03:26:26 -0000
@@ -6985,9 +6985,9 @@ check_for_loop_decls ()
that keep track of the progress of compilation of the current function.
Used for nested functions. */
-struct c_language_function
+struct language_function GTY(())
{
- struct language_function base;
+ struct c_language_function base;
tree named_labels;
tree shadowed_labels;
int returns_value;
@@ -7005,10 +7005,10 @@ void
push_c_function_context (f)
struct function *f;
{
- struct c_language_function *p;
- p = ((struct c_language_function *)
- ggc_alloc (sizeof (struct c_language_function)));
- f->language = (struct language_function *) p;
+ struct language_function *p;
+ p = ((struct language_function *)
+ ggc_alloc (sizeof (struct language_function)));
+ f->language = p;
p->base.x_stmt_tree = c_stmt_tree;
p->base.x_scope_stmt_stack = c_scope_stmt_stack;
@@ -7028,8 +7028,7 @@ void
pop_c_function_context (f)
struct function *f;
{
- struct c_language_function *p
- = (struct c_language_function *) f->language;
+ struct language_function *p = f->language;
tree link;
/* Bring back all the labels that were shadowed. */
@@ -7060,24 +7059,6 @@ pop_c_function_context (f)
current_binding_level = p->binding_level;
f->language = NULL;
-}
-
-/* Mark the language specific parts of F for GC. */
-
-void
-mark_c_function_context (language)
- void *language;
-{
- struct c_language_function *p
- = (struct c_language_function *) language;
-
- if (p == 0)
- return;
-
- mark_c_language_function (&p->base);
- ggc_mark_tree (p->shadowed_labels);
- ggc_mark_tree (p->named_labels);
- gt_ggc_m_binding_level (p->binding_level);
}
/* Copy the DECL_LANG_SPECIFIC data associated with DECL. */
Index: c-objc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-objc-common.c,v
retrieving revision 1.2.6.1
diff -p -u -p -r1.2.6.1 c-objc-common.c
--- c-objc-common.c 14 Mar 2002 21:33:51 -0000 1.2.6.1
+++ c-objc-common.c 4 May 2002 03:26:26 -0000
@@ -221,7 +221,6 @@ c_objc_common_init (filename)
save_lang_status = &push_c_function_context;
restore_lang_status = &pop_c_function_context;
- mark_lang_status = &mark_c_function_context;
lang_expand_expr = c_expand_expr;
lang_expand_decl_stmt = c_expand_decl_stmt;
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.80.2.5
diff -p -u -p -r1.80.2.5 c-tree.h
--- c-tree.h 27 Apr 2002 19:39:35 -0000 1.80.2.5
+++ c-tree.h 4 May 2002 03:26:26 -0000
@@ -197,7 +197,6 @@ extern tree lookup_name
extern tree lookup_name_current_level PARAMS ((tree));
extern void parmlist_tags_warning PARAMS ((void));
extern void pending_xref_error PARAMS ((void));
-extern void mark_c_function_context PARAMS ((void *));
extern void push_c_function_context PARAMS ((struct function *));
extern void pop_c_function_context PARAMS ((struct function *));
extern void pop_label_level PARAMS ((void));
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.341.4.11
diff -p -u -p -r1.341.4.11 function.c
--- function.c 6 Apr 2002 00:08:45 -0000 1.341.4.11
+++ function.c 4 May 2002 03:26:27 -0000
@@ -126,16 +126,11 @@ int virtuals_instantiated;
/* These variables hold pointers to functions to create
target specific, per-function data structures. */
struct machine_function * (*init_machine_status) PARAMS ((void));
-/* This variable holds a pointer to a function to register any
- data items in the target specific, per-function data structure
- that will need garbage collection. */
-void (*mark_machine_status) PARAMS ((void *));
/* Likewise, but for language-specific data. */
void (*init_lang_status) PARAMS ((struct function *));
void (*save_lang_status) PARAMS ((struct function *));
void (*restore_lang_status) PARAMS ((struct function *));
-void (*mark_lang_status) PARAMS ((void *));
/* This is obsolete; do not set it. */
void (*free_lang_status) PARAMS ((struct function *));
@@ -7858,26 +7853,6 @@ reposition_prologue_and_epilogue_notes (
}
}
#endif /* HAVE_prologue or HAVE_epilogue */
-}
-
-/* Some adaptor functions to mark parts of the function structure. */
-
-void
-gt_ggc_mr_machine_function (x)
- void *x;
-{
- if (mark_machine_status)
- (*mark_machine_status) (x);
- else if (x)
- ggc_set_mark (x);
-}
-
-void
-gt_ggc_mr_language_function (x)
- void *x;
-{
- if (mark_lang_status)
- (*mark_lang_status) ((struct lang_function *)x);
}
/* Called once, at initialization, to initialize function.c. */
Index: function.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.h,v
retrieving revision 1.75.4.7
diff -p -u -p -r1.75.4.7 function.h
--- function.h 6 Apr 2002 00:08:46 -0000 1.75.4.7
+++ function.h 4 May 2002 03:26:27 -0000
@@ -368,14 +368,14 @@ struct function GTY(())
/* For md files. */
/* tm.h can use this to store whatever it likes. */
- struct machine_function * GTY ((really ("machine_function"))) machine;
+ struct machine_function * GTY ((maybe_undef (""))) machine;
/* The largest alignment of slot allocated on the stack. */
int stack_alignment_needed;
/* Preferred alignment of the end of stack frame. */
int preferred_stack_boundary;
/* Language-specific code can use this to store whatever it likes. */
- struct language_function * GTY((really ("language_function"))) language;
+ struct language_function * language;
/* For reorg. */
@@ -566,25 +566,16 @@ extern HOST_WIDE_INT get_frame_size PARA
/* Likewise, but for a different than the current function. */
extern HOST_WIDE_INT get_func_frame_size PARAMS ((struct function *));
-/* These variables hold pointers to functions to create
- target specific, per-function data structures. */
+/* A pointer to a function to create target specific, per-function
+ data structures. */
extern struct machine_function * (*init_machine_status) PARAMS ((void));
-/* This variable holds a pointer to a function to register any
- data items in the target specific, per-function data structure
- that will need garbage collection. */
-extern void (*mark_machine_status) PARAMS ((void *));
/* Likewise, but for language-specific data. */
extern void (*init_lang_status) PARAMS ((struct function *));
-extern void (*mark_lang_status) PARAMS ((void *));
extern void (*save_lang_status) PARAMS ((struct function *));
extern void (*restore_lang_status) PARAMS ((struct function *));
/* This is obsolete. Do not set it. */
extern void (*free_lang_status) PARAMS ((struct function *));
-
-/* Adaptor functions that call the hooks if they are set. */
-extern void gt_ggc_mr_machine_function PARAMS ((void *));
-extern void gt_ggc_mr_language_function PARAMS ((void *));
/* Save and restore status information for a nested function. */
extern void restore_emit_status PARAMS ((struct function *));
Index: gengtype.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype.c,v
retrieving revision 1.1.2.11
diff -p -u -p -r1.1.2.11 gengtype.c
--- gengtype.c 3 May 2002 18:02:24 -0000 1.1.2.11
+++ gengtype.c 4 May 2002 03:26:27 -0000
@@ -345,12 +345,11 @@ set_gc_used_type (t, level)
type_p t;
enum gc_used_enum level;
{
- int seen = t->gc_used != GC_UNUSED;
- if (t->gc_used < level)
- t->gc_used = level;
- if (seen)
+ if (t->gc_used >= level)
return;
+ t->gc_used = level;
+
switch (t->kind)
{
case TYPE_STRUCT:
@@ -358,7 +357,19 @@ set_gc_used_type (t, level)
{
pair_p f;
for (f = t->u.s.fields; f; f = f->next)
- set_gc_used_type (f->type, GC_USED);
+ {
+ options_p o;
+ int maybe_null = 0;
+
+ for (o = f->opt; o; o = o->next)
+ if (strcmp (o->name, "maybe_null") == 0)
+ maybe_null = 1;
+
+ if (maybe_null && f->type->kind == TYPE_POINTER)
+ set_gc_used_type (f->type->u.p, GC_MAYBE_POINTED_TO);
+ else
+ set_gc_used_type (f->type, GC_USED);
+ }
break;
}
@@ -778,10 +789,10 @@ write_gc_structure_fields (of, s, val, p
{
const char *tagid = NULL;
const char *length = NULL;
- const char *really = NULL;
const char *special = NULL;
int skip_p = 0;
int always_p = 0;
+ int maybe_undef_p = 0;
options_p oo;
if (f->type->kind == TYPE_SCALAR
@@ -792,8 +803,8 @@ write_gc_structure_fields (of, s, val, p
for (oo = f->opt; oo; oo = oo->next)
if (strcmp (oo->name, "length") == 0)
length = (const char *)oo->info;
- else if (strcmp (oo->name, "really") == 0)
- really = (const char *)oo->info;
+ else if (strcmp (oo->name, "maybe_undef") == 0)
+ maybe_undef_p = 1;
else if (strcmp (oo->name, "tag") == 0)
tagid = (const char *)oo->info;
else if (strcmp (oo->name, "special") == 0)
@@ -813,11 +824,16 @@ write_gc_structure_fields (of, s, val, p
if (skip_p)
continue;
- if (really && (length
- || f->type->kind != TYPE_POINTER
- || f->type->u.p->kind != TYPE_STRUCT))
- error_at_line (&f->line, "field `%s' has invalid option `really'\n",
- f->name);
+ if (maybe_undef_p)
+ {
+ if (f->type->kind != TYPE_POINTER
+ || f->type->u.p->kind != TYPE_STRUCT)
+ error_at_line (&f->line,
+ "field `%s' has invalid option `maybe_undef_p'\n",
+ f->name);
+ if (f->type->u.p->u.s.line.file == NULL)
+ continue;
+ }
if (s->kind == TYPE_UNION && ! always_p )
{
@@ -853,10 +869,7 @@ write_gc_structure_fields (of, s, val, p
case TYPE_POINTER:
if (! length)
{
- if (really)
- fprintf (of, "%*sgt_ggc_mr_%s (%s.%s);\n", indent, "",
- really, val, f->name);
- else if (f->type->u.p->kind == TYPE_STRUCT
+ if (f->type->u.p->kind == TYPE_STRUCT
|| f->type->u.p->kind == TYPE_UNION
|| f->type->u.p->kind == TYPE_LANG_STRUCT)
fprintf (of, "%*sgt_ggc_m_%s (%s.%s);\n", indent, "",
@@ -1130,8 +1143,13 @@ write_gc_types (structures)
fputs ("\n/* GC marker procedures. */\n", header_file);
for (s = structures; s; s = s->next)
- if (s->gc_used == GC_POINTED_TO)
+ if (s->gc_used == GC_POINTED_TO
+ || s->gc_used == GC_MAYBE_POINTED_TO)
{
+ if (s->gc_used == GC_MAYBE_POINTED_TO
+ && s->u.s.line.file == NULL)
+ continue;
+
/* Declare the marker procedure only once. */
fprintf (header_file,
"extern void gt_ggc_m_%s PARAMS ((void *));\n",
Index: gengtype.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype.h,v
retrieving revision 1.1.2.6
diff -p -u -p -r1.1.2.6 gengtype.h
--- gengtype.h 3 May 2002 18:02:24 -0000 1.1.2.6
+++ gengtype.h 4 May 2002 03:26:27 -0000
@@ -65,6 +65,7 @@ struct type {
enum gc_used_enum {
GC_UNUSED = 0,
GC_USED,
+ GC_MAYBE_POINTED_TO,
GC_POINTED_TO
} gc_used;
union {
Index: ada/utils.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils.c,v
retrieving revision 1.8.6.3
diff -p -u -p -r1.8.6.3 utils.c
--- ada/utils.c 15 Apr 2002 21:16:21 -0000 1.8.6.3
+++ ada/utils.c 4 May 2002 03:26:28 -0000
@@ -138,6 +138,11 @@ static struct binding_level *global_bind
/* Binding level structures are initialized by copying this one. */
static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL};
+struct language_function GTY(())
+{
+ int unused;
+};
+
static tree merge_sizes PARAMS ((tree, tree, tree, int, int));
static tree compute_related_constant PARAMS ((tree, tree));
static tree split_plus PARAMS ((tree, tree *));
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.224.2.4
diff -p -u -p -r1.224.2.4 alpha.c
--- config/alpha/alpha.c 14 Mar 2002 21:36:20 -0000 1.224.2.4
+++ config/alpha/alpha.c 4 May 2002 03:26:29 -0000
@@ -493,7 +493,6 @@ override_options ()
#if TARGET_ABI_UNICOSMK
/* Set up function hooks. */
init_machine_status = alpha_init_machine_status;
- mark_machine_status = gt_ggc_m_machine_function;
#endif
}
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.184.2.5
diff -p -u -p -r1.184.2.5 arm.c
--- config/arm/arm.c 9 Apr 2002 21:56:34 -0000 1.184.2.5
+++ config/arm/arm.c 4 May 2002 03:26:30 -0000
@@ -10085,7 +10085,6 @@ arm_init_expanders ()
{
/* Arrange to initialize and mark the machine per-function status. */
init_machine_status = arm_init_machine_status;
- mark_machine_status = gt_ggc_m_machine_function;
}
/* Generate the rest of a function's prologue. */
Index: config/cris/cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.12.8.3
diff -p -u -p -r1.12.8.3 cris.c
--- config/cris/cris.c 14 Mar 2002 21:36:31 -0000 1.12.8.3
+++ config/cris/cris.c 4 May 2002 03:26:31 -0000
@@ -63,7 +63,7 @@ Boston, MA 02111-1307, USA. */
} while (0)
/* Per-function machine data. */
-struct machine_function
+struct machine_function GTY(())
{
int needs_return_address_on_stack;
};
@@ -3132,6 +3132,8 @@ Prev_insn (insn)
return PREV_INSN (insn);
}
#endif
+
+#include "gt-cris.h"
/*
* Local variables:
Index: config/cris/t-cris
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/t-cris,v
retrieving revision 1.1
diff -p -u -p -r1.1 t-cris
--- config/cris/t-cris 11 Oct 2001 17:02:36 -0000 1.1
+++ config/cris/t-cris 4 May 2002 03:26:31 -0000
@@ -41,3 +41,6 @@ $(LIB2FUNCS_EXTRA): $(CRIS_LIB1CSRC)
&& mv -f tmp-$@ $@
TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc
+
+$(out_object_file): gt-cris.h
+gt-cris.h : s-gtype ; @true
Index: config/d30v/d30v.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v.c,v
retrieving revision 1.20.6.3
diff -p -u -p -r1.20.6.3 d30v.c
--- config/d30v/d30v.c 9 Apr 2002 21:56:43 -0000 1.20.6.3
+++ config/d30v/d30v.c 4 May 2002 03:26:31 -0000
@@ -3551,7 +3551,6 @@ d30v_init_expanders ()
{
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = d30v_init_machine_status;
- mark_machine_status = gt_ggc_m_machine_function;
}
/* Find the current function's return address.
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.357.2.4
diff -p -u -p -r1.357.2.4 i386.c
--- config/i386/i386.c 14 Mar 2002 21:36:37 -0000 1.357.2.4
+++ config/i386/i386.c 4 May 2002 03:26:32 -0000
@@ -1004,7 +1004,6 @@ override_options ()
/* Arrange to set up i386_stack_locals for all functions. */
init_machine_status = ix86_init_machine_status;
- mark_machine_status = gt_ggc_m_machine_function;
/* Validate -mregparm= value. */
if (ix86_regparm_string)
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.137.6.5
diff -p -u -p -r1.137.6.5 ia64.c
--- config/ia64/ia64.c 9 Apr 2002 21:56:45 -0000 1.137.6.5
+++ config/ia64/ia64.c 4 May 2002 03:26:33 -0000
@@ -3908,7 +3908,6 @@ ia64_override_options ()
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
- mark_machine_status = gt_ggc_m_machine_function;
}
static enum attr_itanium_requires_unit0 ia64_safe_itanium_requires_unit0 PARAMS((rtx));
Index: config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.13.2.3
diff -p -u -p -r1.13.2.3 mmix.h
--- config/mmix/mmix.h 9 Apr 2002 21:56:50 -0000 1.13.2.3
+++ config/mmix/mmix.h 4 May 2002 03:26:33 -0000
@@ -88,7 +88,7 @@ extern GTY(()) rtx mmix_compare_op1;
/* Per-function machine data. This is normally an opaque type just
defined and used in the tm.c file, but we need to see the definition in
mmix.md too. */
-struct machine_function
+struct machine_function GTY(())
{
int has_landing_pad;
};
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.173.2.3
diff -p -u -p -r1.173.2.3 rs6000.h
--- config/rs6000/rs6000.h 9 Apr 2002 21:56:56 -0000 1.173.2.3
+++ config/rs6000/rs6000.h 4 May 2002 03:26:33 -0000
@@ -1533,7 +1533,7 @@ typedef struct rs6000_stack {
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
-typedef struct machine_function
+typedef struct machine_function GTY(())
{
/* Whether a System V.4 varargs area was created. */
int sysv_varargs_p;
Index: config/xtensa/t-xtensa
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/t-xtensa,v
retrieving revision 1.1.6.2
diff -p -u -p -r1.1.6.2 t-xtensa
--- config/xtensa/t-xtensa 14 Mar 2002 21:37:05 -0000 1.1.6.2
+++ config/xtensa/t-xtensa 4 May 2002 03:26:33 -0000
@@ -27,3 +27,6 @@ LIB1ASMFUNCS = _mulsi3 _nsau _divsi3 _mo
TARGET_LIBGCC2_CFLAGS += -mlongcalls
LIB2FUNCS_EXTRA += $(srcdir)/config/xtensa/lib2funcs.S
+
+$(out_object_file): gt-xtensa.h
+gt-xtensa.h : s-gtype ; @true
Index: config/xtensa/xtensa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.c,v
retrieving revision 1.1.6.4
diff -p -u -p -r1.1.6.4 xtensa.c
--- config/xtensa/xtensa.c 14 Mar 2002 21:37:05 -0000 1.1.6.4
+++ config/xtensa/xtensa.c 4 May 2002 03:26:33 -0000
@@ -84,7 +84,7 @@ const char *xtensa_st_opcodes[(int) MAX_
#define LARGEST_MOVE_RATIO 15
/* Define the structure for the machine field in struct function. */
-struct machine_function
+struct machine_function GTY(())
{
int accesses_prev_frame;
};
@@ -2643,3 +2643,5 @@ a7_overlap_mentioned_p (x)
return 0;
}
+
+#include "gt-xtensa.h"
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.671.2.5
diff -p -u -p -r1.671.2.5 cp-tree.h
--- cp/cp-tree.h 27 Apr 2002 19:41:06 -0000 1.671.2.5
+++ cp/cp-tree.h 4 May 2002 03:26:36 -0000
@@ -810,9 +810,9 @@ struct unparsed_text;
/* Global state pertinent to the current function. */
-struct cp_language_function GTY(())
+struct language_function GTY(())
{
- struct language_function base;
+ struct c_language_function base;
tree x_dtor_label;
tree x_current_class_ptr;
@@ -839,8 +839,7 @@ struct cp_language_function GTY(())
/* The current C++-specific per-function global variables. */
-#define cp_function_chain \
- ((struct cp_language_function *) (cfun->language))
+#define cp_function_chain (cfun->language)
/* In a destructor, the point at which all derived class destroying
has been done, just before any base class destroying will be done. */
@@ -1862,7 +1861,7 @@ struct lang_decl GTY(())
{
tree GTY ((tag ("0"))) sorted_fields;
struct unparsed_text * GTY ((tag ("2"))) pending_inline_info;
- struct cp_language_function * GTY ((tag ("1")))
+ struct language_function * GTY ((tag ("1")))
saved_language_function;
} GTY ((desc ("%1.u3sel + %1.pending_inline_p"))) u;
} GTY ((tag ("1"))) f;
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.847.2.8
diff -p -u -p -r1.847.2.8 decl.c
--- cp/decl.c 27 Apr 2002 19:41:07 -0000 1.847.2.8
+++ cp/decl.c 4 May 2002 03:26:37 -0000
@@ -6313,7 +6313,6 @@ cxx_init_decl_processing ()
/* Fill in back-end hooks. */
init_lang_status = &push_cp_function_context;
free_lang_status = &pop_cp_function_context;
- mark_lang_status = >_ggc_m_cp_language_function;
lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p;
init_decl2 ();
@@ -13734,7 +13733,7 @@ static void
save_function_data (decl)
tree decl;
{
- struct cp_language_function *f;
+ struct language_function *f;
/* Save the language-specific per-function data so that we can
get it back when we really expand this function. */
@@ -13742,9 +13741,9 @@ save_function_data (decl)
19990908);
/* Make a copy. */
- f = ((struct cp_language_function *)
- ggc_alloc (sizeof (struct cp_language_function)));
- memcpy (f, cp_function_chain, sizeof (struct cp_language_function));
+ f = ((struct language_function *)
+ ggc_alloc (sizeof (struct language_function)));
+ memcpy (f, cp_function_chain, sizeof (struct language_function));
DECL_SAVED_FUNCTION_DATA (decl) = f;
/* Clear out the bits we don't need. */
@@ -14420,10 +14419,10 @@ static void
push_cp_function_context (f)
struct function *f;
{
- struct cp_language_function *p
- = ((struct cp_language_function *)
- ggc_alloc_cleared (sizeof (struct cp_language_function)));
- f->language = (struct language_function *) p;
+ struct language_function *p
+ = ((struct language_function *)
+ ggc_alloc_cleared (sizeof (struct language_function)));
+ f->language = p;
/* It takes an explicit call to expand_body to generate RTL for a
function. */
@@ -14443,8 +14442,7 @@ pop_cp_function_context (f)
{
if (f->language)
{
- struct cp_language_function *cp =
- (struct cp_language_function *) f->language;
+ struct language_function *cp = f->language;
if (cp->x_local_names)
VARRAY_FREE (cp->x_local_names);
}
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.244.2.4
diff -p -u -p -r1.244.2.4 semantics.c
--- cp/semantics.c 27 Apr 2002 19:41:08 -0000 1.244.2.4
+++ cp/semantics.c 4 May 2002 03:26:38 -0000
@@ -99,7 +99,7 @@ stmt_tree
current_stmt_tree ()
{
return (cfun
- ? &cfun->language->x_stmt_tree
+ ? &cfun->language->base.x_stmt_tree
: &scope_chain->x_stmt_tree);
}
@@ -1157,7 +1157,7 @@ finish_mem_initializers (init_list)
tree *
current_scope_stmt_stack ()
{
- return &cfun->language->x_scope_stmt_stack;
+ return &cfun->language->base.x_scope_stmt_stack;
}
/* Finish a parenthesized expression EXPR. */
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.88.2.3
diff -p -u -p -r1.88.2.3 tm.texi
--- doc/tm.texi 14 Mar 2002 21:37:21 -0000 1.88.2.3
+++ doc/tm.texi 4 May 2002 03:26:39 -0000
@@ -813,11 +813,9 @@ structure contains a field called @code{
to their own specific data.
If a target needs per-function specific data it should define the type
-@code{struct machine_function} and also the macro
-@code{INIT_EXPANDERS}. This macro should be used to initialize some or
-all of the function pointers @code{init_machine_status}
-and @code{mark_machine_status}. These
-pointers are explained below.
+@code{struct machine_function} and also the macro @code{INIT_EXPANDERS}.
+This macro should be used to initialize the function pointer
+@code{init_machine_status}. This pointer is explained below.
One typical use of per-function, target specific data is to create an
RTX to hold the register containing the function's return address. This
@@ -856,15 +854,6 @@ that structure.
@code{struct machine_function} structures are expected to be freed by GC.
Generally, any memory that they reference must be allocated by using
@code{ggc_alloc}, including the structure itself.
-
-@findex mark_machine_status
-@item mark_machine_status
-This is a @code{void (*)(struct function *)} function pointer. If this
-pointer is non-@code{NULL} it will be called once per function in order
-to mark any data items in the @code{struct machine_function} structure
-which need garbage collection. It will not be called if @code{machine}
-of the function structure is @code{NULL}. It need not mark
-its argument.
@end table
Index: f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.148.6.4
diff -p -u -p -r1.148.6.4 com.c
--- f/com.c 6 Apr 2002 00:08:50 -0000 1.148.6.4
+++ f/com.c 4 May 2002 03:26:41 -0000
@@ -14103,6 +14103,11 @@ static void ffe_finish PARAMS ((void));
static void ffe_init_options PARAMS ((void));
static void ffe_print_identifier PARAMS ((FILE *, tree, int));
+struct language_function GTY(())
+{
+ int unused;
+};
+
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU F77"
#undef LANG_HOOKS_INIT
Index: java/lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.84.6.2
diff -p -u -p -r1.84.6.2 lang.c
--- java/lang.c 6 Apr 2002 00:08:52 -0000 1.84.6.2
+++ java/lang.c 4 May 2002 03:26:44 -0000
@@ -209,6 +209,11 @@ static int dependency_tracking = 0;
#define DEPEND_TARGET_SET 4
#define DEPEND_FILE_ALREADY_SET 8
+struct language_function GTY(())
+{
+ int unused;
+};
+
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU Java"
#undef LANG_HOOKS_INIT
============================================================