Patch for TREE_NOTHROW

Jason Merrill jason@cygnus.com
Fri Mar 10 11:49:00 GMT 2000


We should also deduce TREE_NOTHROW for inline functions that we aren't
writing out yet.

2000-03-10  Jason Merrill  <jason@casey.cygnus.com>

	* toplev.c (rest_of_compilation): Also set TREE_NOTHROW for
	deferred inlines.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.303
diff -c -p -r1.303 toplev.c
*** toplev.c	2000/03/10 08:16:55	1.303
--- toplev.c	2000/03/10 19:45:43
*************** rest_of_compilation (decl)
*** 2967,2972 ****
--- 2967,2978 ----
  	      optimize = saved_optimize;
  	    }
  
+ 	  current_function_nothrow = nothrow_function_p ();
+ 	  if (current_function_nothrow)
+ 	    /* Now we know that this can't throw; set the flag for the benefit
+ 	       of other functions later in this translation unit.  */
+ 	    TREE_NOTHROW (current_function_decl) = 1;
+ 
  	  note_deferral_of_defined_inline_function (decl);
  	  TIMEVAR (integration_time, save_for_inline_nocopy (decl));
  	  DECL_SAVED_INSNS (decl)->inlinable = inlinable;


More information about the Gcc-patches mailing list