diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/Makefile.in | 8 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 48 | ||||
-rw-r--r-- | gcc/except.c | 21 |
5 files changed, 45 insertions, 44 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5527661d225..cc439d7260a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-09-09 Richard Henderson <rth@redhat.com> + + * except.c: Include cgraph.h. + (output_function_exception_table): Invoke + cgraph_varpool_mark_needed_node. + * Makefile.in (except.o): Update. + 2003-09-07 Kelley Cook <kelleycook@wideopenwest.com> * Makefile.in: Define REMAKEFLAGS for LANGUAGES & BOOT_CFLAGS diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 1738b391eca..e210b97dd0c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1535,11 +1535,11 @@ stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) f function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \ $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \ langhooks.h $(PREDICT_H) gt-stmt.h $(OPTABS_H) $(TARGET_H) -except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) langhooks.h \ - insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ +except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \ + langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h + gt-except.h cgraph.h expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \ function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h $(INSN_ATTR_H) insn-config.h \ $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 04416956493..8af149182b7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-09-09 Richard Henderson <rth@redhat.com> + + * decl2.c (mark_member_pointers): Rename from + mark_member_pointers_and_eh_handlers and don't check eh handlers. + 2003-09-09 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de> PR bootstrap/12168 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 4004c8c80de..cbf074fa2bc 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2560,49 +2560,24 @@ generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data) /* Callgraph code does not understand the member pointers. Mark the methods referenced as used. */ static tree -mark_member_pointers_and_eh_handlers (tree *tp, - int *walk_subtrees, - void *data ATTRIBUTE_UNUSED) +mark_member_pointers (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) { - /* Avoid useless walking of complex type and declaration nodes. */ - if (TYPE_P (*tp) || DECL_P (*tp)) - { - *walk_subtrees = 0; - return 0; - } - switch (TREE_CODE (*tp)) + tree t = *tp; + + switch (TREE_CODE (t)) { case PTRMEM_CST: - if (TYPE_PTRMEMFUNC_P (TREE_TYPE (*tp))) - cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (*tp))); - break; - - /* EH handlers will emit EH tables referencing typeinfo. */ - case HANDLER: - if (HANDLER_TYPE (*tp)) - { - tree tinfo = eh_type_info (HANDLER_TYPE (*tp)); - - cgraph_varpool_mark_needed_node (cgraph_varpool_node (tinfo)); - } + if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t))) + cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (t))); break; - case EH_SPEC_BLOCK: - { - tree type; - - for (type = EH_SPEC_RAISES ((*tp)); type; - type = TREE_CHAIN (type)) - { - tree tinfo = eh_type_info (TREE_VALUE (type)); - - cgraph_varpool_mark_needed_node (cgraph_varpool_node (tinfo)); - } - } - break; default: + /* Avoid useless walking of complex type and declaration nodes. */ + if (TYPE_P (t) || DECL_P (t)) + *walk_subtrees = 0; break; } + return 0; } @@ -2612,8 +2587,7 @@ void lower_function (tree fn) { walk_tree_without_duplicates (&DECL_SAVED_TREE (fn), - mark_member_pointers_and_eh_handlers, - NULL); + mark_member_pointers, NULL); } /* This routine is called from the last rule in yyparse (). diff --git a/gcc/except.c b/gcc/except.c index 97e0cb2b2b9..f275866aa6f 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -73,6 +73,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm_p.h" #include "target.h" #include "langhooks.h" +#include "cgraph.h" /* Provide defaults for stuff that may not be defined when using sjlj exceptions. */ @@ -3704,11 +3705,25 @@ output_function_exception_table (void) rtx value; if (type == NULL_TREE) - type = integer_zero_node; + value = const0_rtx; else - type = lookup_type_for_runtime (type); + { + struct cgraph_varpool_node *node; + + type = lookup_type_for_runtime (type); + value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER); + + /* Let cgraph know that the rtti decl is used. Not all of the + paths below go through assemble_integer, which would take + care of this for us. */ + if (TREE_CODE (type) != ADDR_EXPR) + abort (); + type = TREE_OPERAND (type, 0); + node = cgraph_varpool_node (type); + if (node) + cgraph_varpool_mark_needed_node (node); + } - value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER); if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned) assemble_integer (value, tt_format_size, tt_format_size * BITS_PER_UNIT, 1); |