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 table defaults


Currently gcc enables generation unwind tables by default for targets that 
define TARGET_UNWIND_INFO. This effects two targets: ia64 and arm-eabi. The 
latter only requires unwinding tables for C++ exceptions, it does not require 
them for C code.

The attached patch separates the default for flag_unwind_tables from 
TARGET_UNWIND_INFO.

Tested with cross to arm-none-elf, and light testing on ia64-hpux.
Applied to csl-arm-branch.

Paul

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

 * Makefile.in (opts.o): Depend on $(TARGET_H).
 * opts.c: Include target.h.
 (decode_options): Use targetm.unwind_tables_default.
 * target-def.h (TARGET_UNWIND_TABLES_DEFAULT): Define.
 (TARGET_INITIALIZER): Use it
 * target.h (struct gcc_target): Add unwind_tables_default.
 * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define.
Index: Makefile.in
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.1185.2.7
diff -u -p -r1.1185.2.7 Makefile.in
--- Makefile.in	30 Dec 2004 22:33:13 -0000	1.1185.2.7
+++ Makefile.in	27 Jan 2005 19:57:22 -0000
@@ -1536,7 +1536,7 @@ diagnostic.o : diagnostic.c $(DIAGNOSTIC
    input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
 opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
 	coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
-	output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h
+	output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H)
 targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \
 	coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \
 	output.h toplev.h
Index: opts.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/opts.c,v
retrieving revision 1.44.4.6
diff -u -p -r1.44.4.6 opts.c
--- opts.c	17 Aug 2004 03:06:24 -0000	1.44.4.6
+++ opts.c	27 Jan 2005 18:47:15 -0000
@@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - S
 #include "diagnostic.h"
 #include "tm_p.h"		/* For OPTIMIZATION_OPTIONS.  */
 #include "insn-attr.h"		/* For INSN_SCHEDULING.  */
+#include "target.h"
 
 /* Value of the -G xx switch, and whether it was passed or not.  */
 unsigned HOST_WIDE_INT g_switch_value;
@@ -609,11 +610,8 @@ decode_options (unsigned int argc, const
   target_flags = 0;
   set_target_switch ("");
 
-  /* Unwind tables are always present when a target has ABI-specified unwind
-     tables, so the default should be ON.  */
-#ifdef TARGET_UNWIND_INFO
-  flag_unwind_tables = TARGET_UNWIND_INFO;
-#endif
+  /* Some tagets have ABI-specified unwind tables.  */
+  flag_unwind_tables = targetm.unwind_tables_default;
 
 #ifdef OPTIMIZATION_OPTIONS
   /* Allow default optimizations to be specified on a per-machine basis.  */
Index: target-def.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/target-def.h,v
retrieving revision 1.59.2.15
diff -u -p -r1.59.2.15 target-def.h
--- target-def.h	16 Nov 2004 15:48:17 -0000	1.59.2.15
+++ target-def.h	25 Jan 2005 01:50:55 -0000
@@ -368,6 +368,9 @@ Foundation, 59 Temple Place - Suite 330,
    TARGET_SPLIT_COMPLEX_ARG,					\
    }
 
+#ifndef TARGET_UNWIND_TABLES_DEFAULT
+#define TARGET_UNWIND_TABLES_DEFAULT false
+#endif
 
 /* C++ specific.  */
 #ifndef TARGET_CXX_GUARD_TYPE
@@ -470,6 +473,7 @@ Foundation, 59 Temple Place - Suite 330,
   TARGET_TERMINATE_DW2_EH_FRAME_INFO,		\
   TARGET_ASM_FILE_START_APP_OFF,		\
   TARGET_ASM_FILE_START_FILE_DIRECTIVE,		\
+  TARGET_UNWIND_TABLES_DEFAULT,			\
 }
 
 #include "hooks.h"
Index: target.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/target.h,v
retrieving revision 1.67.2.17
diff -u -p -r1.67.2.17 target.h
--- target.h	16 Nov 2004 15:48:17 -0000	1.67.2.17
+++ target.h	25 Jan 2005 01:30:17 -0000
@@ -510,6 +510,8 @@ struct gcc_target
      at the beginning of assembly output.  */
   bool file_start_file_directive;
 
+  /* True if unwinding tables should be generated by default.  */
+  bool unwind_tables_default;
   /* Leave the boolean fields at the end.  */
 };
 
Index: config/ia64/ia64.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.159.2.5
diff -u -p -r1.159.2.5 ia64.h
--- config/ia64/ia64.h	16 Aug 2004 17:13:37 -0000	1.159.2.5
+++ config/ia64/ia64.h	25 Jan 2005 01:52:38 -0000
@@ -2338,6 +2338,8 @@ extern int ia64_final_schedule;
 
 #define TARGET_UNWIND_INFO	1
 
+#define TARGET_UNWIND_TABLES_DEFAULT true
+
 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
 
 /* This function contains machine specific function data.  */

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