public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Suppress unused ARM unwinding tables
@ 2008-03-16  2:24 Paul Brook
  0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2008-03-16  2:24 UTC (permalink / raw)
  To: gcc-patches

The ARM backend currently emits frame unwinding information for all functions.
However in some cases we know we will never try and unwind through a function.  
In these cases we can omit the frame unwind information.  This makes the 
tables smaller, and sometimes means we don't pull in all the unwinding 
library via the personality routine.

Tested on arm-none-eabi.
Applied to svn trunk.

Paul

2008-03-15  Paul Brook  <paul@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_unwind_emit): Suppress unused unwinding
	annotations.
	(arm_output_fn_unwind): Mark functions that can not be unwound.

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 170267)
+++ gcc/config/arm/arm.c	(revision 170268)
@@ -20947,6 +20947,11 @@ arm_unwind_emit (FILE * asm_out_file, rt
   if (!ARM_EABI_UNWIND_TABLES)
     return;
 
+  if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+      && (TREE_NOTHROW (current_function_decl)
+	  || cfun->all_throwers_are_sibcalls))
+    return;
+
   if (GET_CODE (insn) == NOTE || !RTX_FRAME_RELATED_P (insn))
     return;
 
@@ -21027,7 +21032,17 @@ arm_output_fn_unwind (FILE * f, bool pro
   if (prologue)
     fputs ("\t.fnstart\n", f);
   else
-    fputs ("\t.fnend\n", f);
+    {
+      /* If this function will never be unwound, then mark it as such.
+         The came condition is used in arm_unwind_emit to suppress
+	 the frame annotations.  */
+      if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+	  && (TREE_NOTHROW (current_function_decl)
+	      || cfun->all_throwers_are_sibcalls))
+	fputs("\t.cantunwind\n", f);
+
+      fputs ("\t.fnend\n", f);
+    }
 }
 
 static bool

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-16  0:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-16  2:24 Suppress unused ARM unwinding tables Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).