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]

Re: PR7257-related inline flags cleanup


On Monday 22 November 2004 20:25, Richard Henderson wrote:
> I'm looking forward to the rest of the cleanups.

Here's one part that I tested on amd64-linux two weeks ago without
new regressions.  This patch brings death to flag_really_no_inline.

I'm redoing the testing right now.  OK when it passes?

Gr.
Steven


	* common.opt (flag_no_inline): Don't set flag_no_inline to 0 when
	* dojump.c (clear_pending_stack_adjust): Ignore flag_no_inline
	check that only existed for the RTL inliner.
	passed on the command line.  Don't initialize it to 2 by default.
	* c-opts.c (c_common_post_options): Don't set flag_no_inline to
	disable the RTL inliner.
	* flags.h (flag_really_no_inline): Remove extern declaration.
	* opts.c (decode_options): Don't touch flag_no_inline to set or
	clear flag_really_no_inline.
	* toplev.c (flag_really_no_inline): Removed.
	* c-cppbuiltin.c (c_cpp_builtins): Replace flag_really_no_inline
	with just flag_no_inline.
	* c-objc-common.c (c_disregard_inline_limits): Likewise.
	(c_cannot_inline_tree_fn): Likewise.
	* cgraph.c (cgraph_function_possibly_inlined_p): Likewise.
	* cgraphunit.c (cgraph_analyze_function): Likewise.
	(cgraph_decide_inlining): Likewise.
	(cgraph_decide_inlining_incrementally): Likewise.
	(cgraph_preserve_function_body_p): Likewise.
	* langhooks.c (lhd_tree_inlining_cannot_inline_tree_fn): Likewise.

ada/
	* misc.c (gnat_post_options): Don't set flag_no_inline to disable
	the RTL inliner.

cp/
	* decl.c (cxx_init_decl_processing): Don't set flag_no_inline to
	disable the RTL inliner.
	* tree.c (cp_cannot_inline_tree_fn): Check flag_no_inline instead
	of flag_really_no_inline.

fortran/
	* options.c (gfc_post_options): Don't set flag_no_inline to disable
	the RTL inliner.

java/
	* lang.c (java_post_options): Don't set flag_no_inline to disable
	the RTL inliner.


Index: c-cppbuiltin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-cppbuiltin.c,v
retrieving revision 1.26
diff -u -3 -p -r1.26 c-cppbuiltin.c
--- c-cppbuiltin.c	13 Nov 2004 21:11:04 -0000	1.26
+++ c-cppbuiltin.c	24 Nov 2004 19:51:06 -0000
@@ -406,7 +406,7 @@ c_cpp_builtins (cpp_reader *pfile)
 
   if (fast_math_flags_set_p ())
     cpp_define (pfile, "__FAST_MATH__");
-  if (flag_really_no_inline)
+  if (flag_no_inline)
     cpp_define (pfile, "__NO_INLINE__");
   if (flag_signaling_nans)
     cpp_define (pfile, "__SUPPORT_SNAN__");
Index: c-objc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-objc-common.c,v
retrieving revision 1.59
diff -u -3 -p -r1.59 c-objc-common.c
--- c-objc-common.c	2 Nov 2004 20:29:14 -0000	1.59
+++ c-objc-common.c	24 Nov 2004 19:51:06 -0000
@@ -60,7 +60,7 @@ c_disregard_inline_limits (tree fn)
   if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
     return 1;
 
-  return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
+  return (!flag_no_inline && DECL_DECLARED_INLINE_P (fn)
 	  && DECL_EXTERNAL (fn));
 }
 
@@ -74,7 +74,7 @@ c_cannot_inline_tree_fn (tree *fnp)
 		     && DECL_DECLARED_INLINE_P (fn)
 		     && !DECL_IN_SYSTEM_HEADER (fn));
 
-  if (flag_really_no_inline
+  if (flag_no_inline
       && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
     {
       if (do_warning)
Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.131
diff -u -3 -p -r1.131 c-opts.c
--- c-opts.c	24 Nov 2004 19:44:51 -0000	1.131
+++ c-opts.c	24 Nov 2004 19:51:06 -0000
@@ -941,9 +941,6 @@ c_common_post_options (const char **pfil
 
   flag_inline_trees = 1;
 
-  /* Use tree inlining.  */
-  if (!flag_no_inline)
-    flag_no_inline = 1;
   if (flag_inline_functions)
     flag_inline_trees = 2;
 
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.61
diff -u -3 -p -r1.61 cgraph.c
--- cgraph.c	13 Nov 2004 21:11:04 -0000	1.61
+++ cgraph.c	24 Nov 2004 19:51:06 -0000
@@ -630,7 +630,7 @@ bool
 cgraph_function_possibly_inlined_p (tree decl)
 {
   if (!cgraph_global_info_ready)
-    return (DECL_INLINE (decl) && !flag_really_no_inline);
+    return (DECL_INLINE (decl) && !flag_no_inline);
   return DECL_POSSIBLY_INLINED (decl);
 }
 
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.90
diff -u -3 -p -r1.90 cgraphunit.c
--- cgraphunit.c	18 Nov 2004 00:18:43 -0000	1.90
+++ cgraphunit.c	24 Nov 2004 19:51:06 -0000
@@ -655,7 +655,7 @@ cgraph_analyze_function (struct cgraph_n
       else
 	e->inline_failed = N_("function not considered for inlining");
     }
-  if (flag_really_no_inline && !node->local.disregard_inline_limits)
+  if (flag_no_inline && !node->local.disregard_inline_limits)
     node->local.inlinable = 0;
   /* Inlining characteristics are maintained by the cgraph_mark_inline.  */
   node->global.insns = node->local.self_insns;
@@ -1528,7 +1528,7 @@ cgraph_decide_inlining (void)
 		 overall_insns - old_insns);
     }
 
-  if (!flag_really_no_inline)
+  if (!flag_no_inline)
     {
       cgraph_decide_inlining_of_small_functions ();
 
@@ -1622,7 +1622,7 @@ cgraph_decide_inlining_incrementally (st
       cgraph_mark_inline (e);
 
   /* Now do the automatic inlining.  */
-  if (!flag_really_no_inline)
+  if (!flag_no_inline)
     for (e = node->callees; e; e = e->next_callee)
       if (e->callee->local.inlinable
 	  && e->inline_failed
@@ -1732,7 +1732,7 @@ cgraph_preserve_function_body_p (tree de
   if (dump_enabled_p (TDI_tree_all))
     return true;
   if (!cgraph_global_info_ready)
-    return (DECL_INLINE (decl) && !flag_really_no_inline);
+    return (DECL_INLINE (decl) && !flag_no_inline);
   /* Look if there is any clone around.  */
   for (node = cgraph_node (decl); node; node = node->next_clone)
     if (node->global.inlined_to)
Index: common.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/common.opt,v
retrieving revision 1.59
diff -u -3 -p -r1.59 common.opt
--- common.opt	28 Oct 2004 03:42:22 -0000	1.59
+++ common.opt	24 Nov 2004 19:51:06 -0000
@@ -454,7 +454,7 @@ Do not generate .size directives
 ; only when actually used.  Used in conjunction with -g.  Also
 ; does the right thing with #pragma interface.
 finline
-Common Report Var(flag_no_inline,0) Init(2)
+Common Report Var(flag_no_inline)
 Pay attention to the \"inline\" keyword
 
 finline-functions
Index: dojump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dojump.c,v
retrieving revision 1.32
diff -u -3 -p -r1.32 dojump.c
--- dojump.c	24 Nov 2004 19:44:58 -0000	1.32
+++ dojump.c	24 Nov 2004 19:51:06 -0000
@@ -70,8 +70,7 @@ clear_pending_stack_adjust (void)
 {
   if (optimize > 0
       && (! flag_omit_frame_pointer || current_function_calls_alloca)
-      && EXIT_IGNORE_STACK
-      && ! (DECL_INLINE (current_function_decl) && ! flag_no_inline))
+      && EXIT_IGNORE_STACK)
     discard_pending_stack_adjust ();
 }
 
Index: flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.150
diff -u -3 -p -r1.150 flags.h
--- flags.h	28 Sep 2004 20:34:17 -0000	1.150
+++ flags.h	24 Nov 2004 19:51:06 -0000
@@ -149,11 +149,6 @@ extern int flag_pcc_struct_return;
 
 extern int flag_complex_divide_method;
 
-/* Nonzero means that we don't want inlining by virtue of -fno-inline,
-   not just because the tree inliner turned us off.  */
-
-extern int flag_really_no_inline;
-
 /* Nonzero if we are only using compiler to check syntax errors.  */
 
 extern int rtl_dump_and_exit;
Index: langhooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.c,v
retrieving revision 1.79
diff -u -3 -p -r1.79 langhooks.c
--- langhooks.c	14 Oct 2004 23:15:19 -0000	1.79
+++ langhooks.c	24 Nov 2004 19:51:06 -0000
@@ -310,7 +310,7 @@ lhd_tree_inlining_walk_subtrees (tree *t
 int
 lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp)
 {
-  if (flag_really_no_inline
+  if (flag_no_inline
       && lookup_attribute ("always_inline", DECL_ATTRIBUTES (*fnp)) == NULL)
     return 1;
 
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.88
diff -u -3 -p -r1.88 opts.c
--- opts.c	18 Nov 2004 06:39:47 -0000	1.88
+++ opts.c	24 Nov 2004 19:51:06 -0000
@@ -608,11 +608,6 @@ decode_options (unsigned int argc, const
   if (flag_pic && !flag_pie)
     flag_shlib = 1;
 
-  if (flag_no_inline == 2)
-    flag_no_inline = 0;
-  else
-    flag_really_no_inline = flag_no_inline;
-
   /* Set flag_no_inline before the post_options () hook.  The C front
      ends use it to determine tree inlining defaults.  FIXME: such
      code should be lang-independent when all front ends use tree
@@ -632,9 +627,6 @@ decode_options (unsigned int argc, const
 	warning ("-Wuninitialized is not supported without -O");
     }
 
-  if (flag_really_no_inline == 2)
-    flag_really_no_inline = flag_no_inline;
-
   /* The optimization to partition hot and cold basic blocks into separate
      sections of the .o and executable files does not work (currently)
      with exception handling.  If flag_exceptions is turned on we need to
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.932
diff -u -3 -p -r1.932 toplev.c
--- toplev.c	12 Nov 2004 16:37:40 -0000	1.932
+++ toplev.c	24 Nov 2004 19:51:06 -0000
@@ -271,11 +271,6 @@ int flag_pcc_struct_return = DEFAULT_PCC
 
 int flag_complex_divide_method = 0;
 
-/* Nonzero means that we don't want inlining by virtue of -fno-inline,
-   not just because the tree inliner turned us off.  */
-
-int flag_really_no_inline = 2;
-
 /* Nonzero means we should be saving declaration info into a .X file.  */
 
 int flag_gen_aux_info = 0;
Index: ada/misc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v
retrieving revision 1.94
diff -u -3 -p -r1.94 misc.c
--- ada/misc.c	24 Nov 2004 19:45:06 -0000	1.94
+++ ada/misc.c	24 Nov 2004 19:51:07 -0000
@@ -349,8 +349,6 @@ gnat_post_options (const char **pfilenam
 {
   flag_inline_trees = 1;
 
-  if (!flag_no_inline)
-    flag_no_inline = 1;
   if (flag_inline_functions)
     flag_inline_trees = 2;
 
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1332
diff -u -3 -p -r1.1332 decl.c
--- cp/decl.c	24 Nov 2004 19:45:18 -0000	1.1332
+++ cp/decl.c	24 Nov 2004 19:51:07 -0000
@@ -2985,10 +2985,7 @@ cxx_init_decl_processing (void)
   if (!flag_permissive)
     flag_pedantic_errors = 1;
   if (!flag_no_inline)
-    {
-      flag_inline_trees = 1;
-      flag_no_inline = 1;
-    }
+    flag_inline_trees = 1;
   if (flag_inline_functions)
     flag_inline_trees = 2;
 
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.419
diff -u -3 -p -r1.419 tree.c
--- cp/tree.c	12 Nov 2004 21:47:09 -0000	1.419
+++ cp/tree.c	24 Nov 2004 19:51:08 -0000
@@ -2031,7 +2031,7 @@ cp_cannot_inline_tree_fn (tree* fnp)
 	return 1;
     }
 
-  if (flag_really_no_inline
+  if (flag_no_inline
       && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
     return 1;
 
Index: fortran/options.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/options.c,v
retrieving revision 1.14
diff -u -3 -p -r1.14 options.c
--- fortran/options.c	24 Nov 2004 19:45:27 -0000	1.14
+++ fortran/options.c	24 Nov 2004 19:51:08 -0000
@@ -105,9 +105,6 @@ gfc_post_options (const char **pfilename
 
   flag_inline_trees = 1;
 
-  /* Use tree inlining.  */
-  if (!flag_no_inline)
-    flag_no_inline = 1;
   if (flag_inline_functions)
     flag_inline_trees = 2;
 
Index: java/lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.164
diff -u -3 -p -r1.164 lang.c
--- java/lang.c	24 Nov 2004 19:45:32 -0000	1.164
+++ java/lang.c	24 Nov 2004 19:51:08 -0000
@@ -587,9 +587,6 @@ java_post_options (const char **pfilenam
 {
   const char *filename = *pfilename;
 
-  /* Use tree inlining.  */
-  if (!flag_no_inline)
-    flag_no_inline = 1;
   if (flag_inline_functions)
     flag_inline_trees = 2;
 


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