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: inlining default


Mark Mitchell wrote:-

> --On Wednesday, December 12, 2001 02:00:03 PM +0000 Jason Merrill 
> <jason@redhat.com> wrote:
> 
> >It seems that Neil's 2001-11-15 changes to option parsing had a side
> >effect of turning on tree inlining at -O0 for C and C++ unless suppressed
> >with -fno-inline, because we now set flag_tree_inline from flag_no_inline
> >before setting flag_no_inline from optimize.  Is this what we want?  I
> >would prefer to leave it off by default with -O0, but many compilers turn
> >it on unless specifically disabled.  What do other people think?
> 
> I think we should leave it off at -O0.  I can't see a compelling
> reason to change our historical practice.

I think this inadvertant semantic change is cured by the patch below.
Let me know if you want me to bootstrap, test and apply it.

Neil.

	* toplev.c (process_options, parse_options_and_default_flags):
	Set flag_no_inline before the post_options hook.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.555
diff -u -p -r1.555 toplev.c
--- toplev.c	2001/12/12 22:50:03	1.555
+++ toplev.c	2001/12/13 07:55:55
@@ -4754,15 +4754,11 @@ parse_options_and_default_flags (argc, a
 	}
     }
 
-  /* All command line options have been parsed; allow the front end to
-     perform consistency checks, etc.  */
-  (*lang_hooks.post_options) ();
-}
-
-/* Process the options that have been parsed.  */
-static void
-process_options ()
-{
+  /* 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
+     inlining, in which case it, and this condition, should be moved
+     to the top of process_options() instead.  */
   if (optimize == 0)
     {
       /* Inlining does not work if not optimizing,
@@ -4777,6 +4773,15 @@ process_options ()
 	warning ("-Wuninitialized is not supported without -O");
     }
 
+  /* All command line options have been parsed; allow the front end to
+     perform consistency checks, etc.  */
+  (*lang_hooks.post_options) ();
+}
+
+/* Process the options that have been parsed.  */
+static void
+process_options ()
+{
 #ifdef OVERRIDE_OPTIONS
   /* Some machines may reject certain combinations of options.  */
   OVERRIDE_OPTIONS;


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