--- p/gpc.h.orig Thu Mar 27 21:46:08 2003 +++ p/gpc.h Sat Mar 29 23:42:36 2003 @@ -798,6 +798,7 @@ extern tree build_operator_heading PARAMS ((tree, tree, tree, tree)); extern tree finish_struct PARAMS ((tree, tree)); extern tree getdecls PARAMS ((void)); +extern void storedecls PARAMS ((tree)); extern int global_bindings_p PARAMS ((void)); extern int in_parm_level_p PARAMS ((void)); extern void init_decl_processing PARAMS ((void)); --- p/gpc-decl.c.orig Sat Mar 29 23:00:10 2003 +++ p/gpc-decl.c Sun Mar 30 00:02:49 2003 @@ -1236,6 +1236,14 @@ return current_binding_level->names; } +void +storedecls (decls) + tree decls; +{ + current_binding_level->names = decls; + current_binding_level->names_end = tree_last (decls); +} + /* Look up NAME in the current binding level and its superiors in the namespace of variables, functions and typedefs. Return a ..._DECL node of some kind representing its definition, --- p/module.c.orig Sat Mar 29 23:39:06 2003 +++ p/module.c Sun Mar 30 01:01:14 2003 @@ -1733,7 +1733,7 @@ MEMFILE *s; gpi_int start_of_nodes, size_of_offsets; { - tree result; + tree result, tmp; int n, nodes_count; size_of_offsets -= sizeof (gpi_int); /* main node id */ nodes_count = (size_of_offsets / sizeof (gpi_int)) + NUM_SPECIAL_NODES; @@ -1764,8 +1764,12 @@ push_obstacks_nochange (); end_temporary_allocation (); #endif - + /* Don't let any declaraions be pushed now. + This is done later in import_node(). */ + tmp = getdecls (); + storedecls (NULL_TREE); result = load_node (); + storedecls (tmp); #ifndef EGCS97 pop_obstacks (); #endif @@ -2982,6 +2986,7 @@ assert (!EM (t)); IDENTIFIER_LOCAL_VALUE (name) = save_local; IDENTIFIER_GLOBAL_VALUE (name) = save_global; + TREE_CHAIN (t) = NULL_TREE; for (a = args; a; a = TREE_CHAIN (a)) DECL_CONTEXT (a) = t; @@ -3144,6 +3149,7 @@ NULL_TREE, qualifiers, build_tree_list (get_identifier ("Name"), assembler_name) /* attributes */)); IDENTIFIER_LOCAL_VALUE (name) = save_local; IDENTIFIER_GLOBAL_VALUE (name) = save_global; + TREE_CHAIN (t) = NULL_TREE; } copy_decl_flags (t, tt); copy_decl_info (t, tt); @@ -3956,6 +3962,7 @@ else dest = src; TREE_READONLY (t) = readonly; +#if 0 /* @@ Push only those decls that were *not* pushed already during load_node() to avoid duplicates. Finally, load_node() should not push any of them, so we should do it here unconditionally. */ @@ -3963,6 +3970,7 @@ if (TREE_CODE (t) != FUNCTION_DECL) #else if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != FUNCTION_DECL) +#endif #endif pushdecl_current_nocheck (t); if (current_module && current_module->main_program)