]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (dw_fde_struct): Add 'nothrow'.
authorJason Merrill <jason@casey.cygnus.com>
Wed, 8 Mar 2000 23:05:30 +0000 (23:05 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 8 Mar 2000 23:05:30 +0000 (18:05 -0500)
        * dwarf2out.c (dw_fde_struct): Add 'nothrow'.
        (dwarf2out_begin_prologue): Set it.
        (output_call_frame_info): Don't emit EH unwind info for leaves.

From-SVN: r32434

gcc/ChangeLog
gcc/dwarf2out.c

index 17ab03e7a19abb4a96dbc32f65613e67a521293a..d8b55f5e5755ce62ae625778e00d2235cab05c27 100644 (file)
@@ -1,5 +1,9 @@
 2000-03-08  Jason Merrill  <jason@casey.cygnus.com>
 
+       * dwarf2out.c (dw_fde_struct): Add 'nothrow'.
+       (dwarf2out_begin_prologue): Set it.
+       (output_call_frame_info): Don't emit EH unwind info for leaves.
+
        * flow.c (count_basic_blocks, find_basic_blocks_1): A rethrow
        can occur outside of an EH region.
        * except.c: Correct comments about rethrow behavior.
index a44162e30e2de08321e13558e357e3481a1acd4f..20e8a1be4bd0a7a979db79bb6576c6c29d356830 100644 (file)
@@ -129,6 +129,7 @@ typedef struct dw_fde_struct
   char *dw_fde_current_label;
   char *dw_fde_end;
   dw_cfi_ref dw_fde_cfi;
+  int nothrow;
 }
 dw_fde_node;
 
@@ -1624,6 +1625,17 @@ output_call_frame_info (for_eh)
   /* Do we want to include a pointer to the exception table?  */
   int eh_ptr = for_eh && exception_table_p ();
 
+  /* If we don't have any functions we'll want to unwind out of, don't
+     emit any EH unwind information.  */
+  if (for_eh)
+    {
+      for (i = 0; i < fde_table_in_use; ++i)
+       if (! fde_table[i].nothrow)
+         goto found;
+      return;
+    found:;
+    }
+
   fputc ('\n', asm_out_file);
 
   /* We're going to be generating comments, so turn on app.  */
@@ -1756,6 +1768,10 @@ output_call_frame_info (for_eh)
     {
       fde = &fde_table[i];
 
+      /* Don't emit EH unwind info for leaf functions.  */
+      if (for_eh && fde->nothrow)
+       continue;
+
       ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i*2);
       ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i*2);
 #ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
@@ -1874,6 +1890,9 @@ dwarf2out_begin_prologue ()
   fde->dw_fde_end = NULL;
   fde->dw_fde_cfi = NULL;
 
+  /* Normally, only calls can throw, so a leaf function will never throw.  */
+  fde->nothrow = (current_function_is_leaf && !asynchronous_exceptions);
+
   args_size = old_args_size = 0;
 }