This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[arm] Omit register save in noreturn functions


arm.c:arm_compute_func_type contains logic to avoid saving registers in the 
function prologue if the function never returns, and we don't need to unwind 
through it.
The patch below makes this condition hold when exceptions and unwinding tables 
are disabled. This is the case for most C code.

This is a regression from gcc 3.4.

Tested on arm-none-eabi.
Applied to mainline and 4.1.

Paul

2006-01-19  Paul Brook  <paul@codesourcery.com>

	* gcc/config/arm/arm.c (arm_compute_func_type): Treat all functions
	as nothrow when unwinding tables are disabled.

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 109956)
+++ gcc/config/arm/arm.c	(working copy)
@@ -1403,7 +1403,9 @@ arm_compute_func_type (void)
      register values that will never be needed again.  This optimization
      was added to speed up context switching in a kernel application.  */
   if (optimize > 0
-      && TREE_NOTHROW (current_function_decl)
+      && (TREE_NOTHROW (current_function_decl)
+          || !(flag_unwind_tables
+               || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)))
       && TREE_THIS_VOLATILE (current_function_decl))
     type |= ARM_FT_VOLATILE;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]