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]

[csl-arm] Unwinding through noreturn functions.


The arm backend checks current_function_nothrow to determine if it is safe to 
omit the LR save for noreturn functions. Unfortunately this check happens 
before current_function_nothrow is set.

The attached patch replaces the check with a more conservative check, namely 
was the function declared nothrow and do we need unwind tables.

Tested with cross to arm-none-eabi.
Applied to csl-arm-branch.

Paul

2005-01-25  Paul Brook  <paul@codesourcery.com>

 * config/arm/arm.c (arm_compute_func_type): Don't use
 current_function_nothrow.
Index: config/arm/arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.67
diff -u -p -r1.303.2.67 arm.c
--- config/arm/arm.c	5 Jan 2005 18:33:22 -0000	1.303.2.67
+++ config/arm/arm.c	25 Jan 2005 00:35:58 -0000
@@ -1251,7 +1251,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
-      && current_function_nothrow
+      && (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]