This is the mail archive of the gcc-bugs@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]

[Bug bootstrap/36907] [4.4 Regression]: Gcc failed to bootstrap



------- Comment #18 from gnu at the-meissners dot org  2008-07-24 20:11 -------
Subject: Re:  [4.4 Regression]: Gcc failed to bootstrap

On Thu, Jul 24, 2008 at 07:33:01PM -0000, hjl dot tools at gmail dot com wrote:
> 
> 
> ------- Comment #17 from hjl dot tools at gmail dot com  2008-07-24 19:32 -------
> (In reply to comment #16)
> > I haven't done a bootstrap built yet, but could you try this patch on the
> > ia-64?  When I try it via a cross compiler, it works fine, but I wonder whether
> > random ports will do weird things (like leak memory) if OVERRIDE_OPTIONS is run
> > a second time.  I suspect we may need a macro that says whether it is safe to
> > run OVERRIDE_OPTIONS a second time.
> > 
> > 2008-07-24  Michael Meissner  <gnu@the-meissners.org>
> > 
> >         * opts.c (decode_options): Rerun OVERRIDE_OPTIONS when being run a
> >         second time to allow the backend to override the default options.
> > 
> 
> Taking a look at override_options in i386.c, I am not sure
> running it more than once is a good idea.

Yes, I came to the same conclusion when trying a bootstrap.  This patch adds a
new SECONDARY_OVERRIDE_OPTION to be run in the recursive case, and defined it
in the ia64.

2008-07-24  Michael Meissner  <gnu@the-meissners.org>

        * opts.c (decode_options): Run SECONDARY_OVERRIDE_OPTIONS if it is
        defined when being run a second time to allow the backend to
        override the default options.

        * config/ia64/ia64.h (SECONDARY_OVERRIDE_OPTIONS): Define to be
        the same as OVERRIDE_OPTIONS.

        * doc/tm.texi (SECONDARY_OVERRIDE_OPTIONS): Document.

Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi     (revision 138117)
+++ gcc/doc/tm.texi     (working copy)
@@ -814,6 +814,12 @@ Don't use this macro to turn on various 
 @option{-O}.  That is what @code{OPTIMIZATION_OPTIONS} is for.
 @end defmac

+@defmac SECONDARY_OVERRIDE_OPTIONS
+This is similar to @code{OVERRIDE_OPTIONS} but it is run after the
+compiler processes the @code{optimize}, @code{hot}, or @code{cold}
+attributes to change the optimization options.
+@end defmac
+
 @defmac C_COMMON_OVERRIDE_OPTIONS
 This is similar to @code{OVERRIDE_OPTIONS} but is only used in the C
 language frontends (C, Objective-C, C++, Objective-C++) and so can be
Index: gcc/opts.c
===================================================================
--- gcc/opts.c  (revision 138117)
+++ gcc/opts.c  (working copy)
@@ -1066,6 +1066,12 @@ decode_options (unsigned int argc, const
       flag_unwind_tables = targetm.unwind_tables_default;
     }

+#ifdef SECONDARY_OVERRIDE_OPTIONS
+  /* Some machines may reject certain combinations of options.  */
+  if (! first_time_p)
+    SECONDARY_OVERRIDE_OPTIONS;
+#endif
+
 #ifdef OPTIMIZATION_OPTIONS
   /* Allow default optimizations to be specified on a per-machine basis.  */
   OPTIMIZATION_OPTIONS (optimize, optimize_size);
Index: gcc/config/ia64/ia64.h
===================================================================
--- gcc/config/ia64/ia64.h      (revision 138117)
+++ gcc/config/ia64/ia64.h      (working copy)
@@ -121,6 +121,11 @@ extern enum processor_type ia64_tune;

 #define OVERRIDE_OPTIONS ia64_override_options ()

+/* Like OVERRIDE_OPTIONS, but run after the optimize, hot, or cold attributes
+   are processed.  */
+
+#define SECONDARY_OVERRIDE_OPTIONS ia64_override_options ()
+
 /* Some machines may desire to change what optimizations are performed for
    various optimization levels.  This macro, if defined, is executed once just
    after the optimization level is determined and before the remainder of the


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36907


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