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]

[LTO][PATCH] Handle -fexceptions properly.


Hi,

   This patch handles the -fexceptions flag properly in LTO.
Previously we unconditionally set flag_exceptions flag to 1 even when
-fno-exceptions is given in command line.  This patch also disable a
check for NOTHROW compatibility check when -fno-exceptions is given to
LTO.

-Doug

2008-10-21  Doug Kwan  <dougkwan@google.com>

	* lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
	exceptions flag is set.
	* lto-lang.c: (lto_init_options) Set default exceptions flag.
	(lto_init_eh): Remove exceptions flag initialization.

Index: gcc/gcc/lto/lto.c
===================================================================
--- gcc/gcc/lto/lto.c	(revision 141288)
+++ gcc/gcc/lto/lto.c	(working copy)
@@ -811,6 +811,7 @@ lto_fixup_tree (tree *tp, int *walk_subt
       if (t != prevailing)
 	{
 	  if (TREE_CODE (t) == FUNCTION_DECL
+	      && flag_exceptions
 	      && TREE_NOTHROW (prevailing) != TREE_NOTHROW (t))
 	    {
 	      if (TREE_NOTHROW (prevailing))
Index: gcc/gcc/lto/lto-lang.c
===================================================================
--- gcc/gcc/lto/lto-lang.c	(revision 141288)
+++ gcc/gcc/lto/lto-lang.c	(working copy)
@@ -664,6 +664,9 @@ lto_init_options (unsigned int argc ATTR
      decisions about what to output.  */
   flag_unit_at_a_time = 1;

+  /* Enable exceptions by default.  */
+  flag_exceptions = 1;
+
   return CL_LTO;
 }

@@ -993,7 +996,6 @@ static void
 lto_init_eh (void)
 {
   /* GIMPLE supports exceptions.  */
-  flag_exceptions = 1;
   eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
 					     ? "__gcc_personality_sj0"
 					     : "__gcc_personality_v0");


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