public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: gcc-patches@gcc.gnu.org
Subject: Suppress unused ARM unwinding tables
Date: Sun, 16 Mar 2008 02:24:00 -0000	[thread overview]
Message-ID: <200803160058.42240.paul@codesourcery.com> (raw)

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

                 reply	other threads:[~2008-03-16  0:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200803160058.42240.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).