except.c: Include cgraph.h.
authorRichard Henderson <rth@redhat.com>
Wed, 10 Sep 2003 00:09:09 +0000 (17:09 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 10 Sep 2003 00:09:09 +0000 (17:09 -0700)
        * except.c: Include cgraph.h.
        (output_function_exception_table): Invoke
        cgraph_varpool_mark_needed_node.
        * Makefile.in (except.o): Update.

        * decl2.c (mark_member_pointers): Rename from
        mark_member_pointers_and_eh_handlers and don't check eh handlers.

From-SVN: r71254

gcc/ChangeLog
gcc/Makefile.in
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/except.c

index 5527661d2254248f7469683d1d6bb6c7f686e49b..cc439d7260ab4f947ddb11fc0e14734df880fe5c 100644 (file)
@@ -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
index 1738b391eca7a52b9a317e3c881e3941220c7ac4..e210b97dd0c0b7f72a1f424b1d3ac677629c2222 100644 (file)
@@ -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 \
index 044169564933f892dc1d6973dc6a05bb26bbe6e1..8af149182b73f631e79a6a0db4ff6da38eb5ff05 100644 (file)
@@ -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
index 4004c8c80de65a63c4978aa56b88bae5a93cd61a..cbf074fa2bc7e1877e0771519df7004a2655952e 100644 (file)
@@ -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 ().
index 97e0cb2b2b90fea5cedbbb487e35237d151b3bba..f275866aa6fca2ee37c99773098312d82327d8f6 100644 (file)
@@ -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);