OSDN Git Service

* configure.in: Delete three unused variables. Move a variable
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index a4cd1df..339b198 100644 (file)
@@ -103,7 +103,7 @@ extern void reg_alloc PARAMS ((void));
 
 static void general_init PARAMS ((char *));
 static void parse_options_and_default_flags PARAMS ((int, char **));
-static void do_compile PARAMS ((void));
+static void do_compile PARAMS ((int));
 static void process_options PARAMS ((void));
 static void backend_init PARAMS ((void));
 static int lang_dependent_init PARAMS ((const char *));
@@ -113,6 +113,7 @@ static void finalize PARAMS ((void));
 static void set_target_switch PARAMS ((const char *));
 
 static void crash_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
+static void setup_core_dumping PARAMS ((void));
 static void compile_file PARAMS ((void));
 static void display_help PARAMS ((void));
 static void display_target_options PARAMS ((void));
@@ -175,7 +176,7 @@ const char *dump_base_name;
 
 /* Name to use as a base for auxiliary output files.  */
 
-const char *aux_base_name;
+static const char *aux_base_name;
 
 /* Format to use to print dumpfile index value */
 #ifndef DUMPFILE_FORMAT
@@ -253,9 +254,9 @@ enum dump_file_index
   DFI_peephole2,
   DFI_rnreg,
   DFI_ce3,
+  DFI_bbro,
   DFI_sched2,
   DFI_stack,
-  DFI_bbro,
   DFI_mach,
   DFI_dbr,
   DFI_MAX
@@ -304,9 +305,9 @@ static struct dump_file_info dump_file[DFI_MAX] =
   { "peephole2", 'z', 1, 0, 0 },
   { "rnreg",   'n', 1, 0, 0 },
   { "ce3",     'E', 1, 0, 0 },
+  { "bbro",    'B', 1, 0, 0 },
   { "sched2",  'R', 1, 0, 0 },
   { "stack",   'k', 1, 0, 0 },
-  { "bbro",    'B', 1, 0, 0 },
   { "mach",    'M', 1, 0, 0 },
   { "dbr",     'd', 0, 0, 0 },
 };
@@ -320,7 +321,7 @@ static void close_dump_file PARAMS ((enum dump_file_index,
 int rtl_dump_and_exit;
 int flag_print_asm_name;
 static int version_flag;
-static char *filename;
+static const char *filename;
 enum graph_dump_types graph_dump_format;
 
 /* Name for output file of assembly code, specified with -o.  */
@@ -377,6 +378,10 @@ tree current_function_func_begin_label;
 
 int flag_eliminate_dwarf2_dups = 0;
 
+/* Nonzero if doing unused type elimination.  */
+
+int flag_eliminate_unused_debug_types = 1;
+
 /* Nonzero if generating code to do profiling.  */
 
 int profile_flag = 0;
@@ -514,13 +519,22 @@ int flag_strength_reduce = 0;
    UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
    unrolled.  */
 
-int flag_unroll_loops;
+int flag_old_unroll_loops;
 
 /* Nonzero enables loop unrolling in unroll.c.  All loops are unrolled.
    This is generally not a win.  */
 
+int flag_old_unroll_all_loops;
+
+/* Enables unrolling of simple loops in loop-unroll.c.  */
+int flag_unroll_loops;
+
+/* Enables unrolling of all loops in loop-unroll.c.  */
 int flag_unroll_all_loops;
 
+/* Nonzero enables loop peeling.  */
+int flag_peel_loops;
+
 /* Nonzero enables loop unswitching.  */
 int flag_unswitch_loops;
 
@@ -595,7 +609,7 @@ int flag_finite_math_only = 0;
 /* Zero means that floating-point math operations cannot generate a
    (user-visible) trap.  This is the case, for example, in nonstop
    IEEE 754 arithmetic.  Trapping conditions include division by zero,
-   overflow, underflow, invalid and inexact, but does not include 
+   overflow, underflow, invalid and inexact, but does not include
    operations on signaling NaNs (see below).  */
 
 int flag_trapping_math = 1;
@@ -744,6 +758,13 @@ int flag_pedantic_errors = 0;
 int flag_schedule_insns = 0;
 int flag_schedule_insns_after_reload = 0;
 
+/* When flag_schedule_insns_after_reload is set, use EBB scheduler.  */
+int flag_sched2_use_superblocks = 0;
+
+/* When flag_schedule_insns_after_reload is set, construct traces and EBB
+   scheduler.  */
+int flag_sched2_use_traces = 0;
+
 /* The following flags have effect only for scheduling before register
    allocation:
 
@@ -882,6 +903,10 @@ int flag_new_regalloc = 0;
 
 int flag_tracer = 0;
 
+/* Nonzero if we perform whole unit at a time compilation.  */
+
+int flag_unit_at_a_time = 0;
+
 /* Values of the -falign-* flags: how much to align labels in code.
    0 means `use default', 1 means `don't align'.
    For each variable, there is an _log variant which is the power
@@ -978,6 +1003,8 @@ static const lang_independent_options f_options[] =
 {
   {"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
    N_("Perform DWARF2 duplicate elimination") },
+  {"eliminate-unused-debug-types", &flag_eliminate_unused_debug_types, 1,
+   N_("Perform unused type elimination in debug info") },
   {"float-store", &flag_float_store, 1,
    N_("Do not store floats in registers") },
   {"defer-pop", &flag_defer_pop, 1,
@@ -988,6 +1015,8 @@ static const lang_independent_options f_options[] =
    N_("Optimize sibling and tail recursive calls") },
   {"tracer", &flag_tracer, 1,
    N_("Perform superblock formation via tail duplication") },
+  {"unit-at-a-time", &flag_unit_at_a_time, 1,
+   N_("Compile whole compilation unit at a time") },
   {"cse-follow-jumps", &flag_cse_follow_jumps, 1,
    N_("When running CSE, follow jumps to their targets") },
   {"cse-skip-blocks", &flag_cse_skip_blocks, 1,
@@ -1002,6 +1031,12 @@ static const lang_independent_options f_options[] =
    N_("Perform loop unrolling when iteration count is known") },
   {"unroll-all-loops", &flag_unroll_all_loops, 1,
    N_("Perform loop unrolling for all loops") },
+  {"old-unroll-loops", &flag_old_unroll_loops, 1,
+   N_("Perform loop unrolling when iteration count is known") },
+  {"old-unroll-all-loops", &flag_old_unroll_all_loops, 1,
+   N_("Perform loop unrolling for all loops") },
+  {"peel-loops", &flag_peel_loops, 1,
+   N_("Perform loop peeling") },
   {"unswitch-loops", &flag_unswitch_loops, 1,
    N_("Perform loop unswitching") },
   {"prefetch-loop-arrays", &flag_prefetch_loop_arrays, 1,
@@ -1072,6 +1107,10 @@ static const lang_independent_options f_options[] =
    N_("Allow speculative motion of some loads") },
   {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
    N_("Allow speculative motion of more loads") },
+  {"sched2-use-superblocks", &flag_sched2_use_superblocks, 1,
+   N_("If scheduling post reload, do superblock sheduling") },
+  {"sched2-use-traces", &flag_sched2_use_traces, 1,
+   N_("If scheduling post reload, do trace sheduling") },
   {"branch-count-reg",&flag_branch_on_count_reg, 1,
    N_("Replace add,compare,branch with branch on count reg") },
   {"pic", &flag_pic, 1,
@@ -1693,6 +1732,29 @@ crash_signal (signo)
   internal_error ("%s", strsignal (signo));
 }
 
+/* Arrange to dump core on error.  (The regular error message is still
+   printed first, except in the case of abort().)  */
+
+static void
+setup_core_dumping ()
+{
+#ifdef SIGABRT
+  signal (SIGABRT, SIG_DFL);
+#endif
+#if defined(HAVE_SETRLIMIT)
+  {
+    struct rlimit rlim;
+    if (getrlimit (RLIMIT_CORE, &rlim) != 0)
+      fatal_io_error ("getting core file size maximum limit");
+    rlim.rlim_cur = rlim.rlim_max;
+    if (setrlimit (RLIMIT_CORE, &rlim) != 0)
+      fatal_io_error ("setting core file size limit to maximum");
+  }
+#endif
+  diagnostic_abort_on_error (global_dc);
+}
+
+
 /* Strip off a legitimate source ending from the input string NAME of
    length LEN.  Rather than having to know the names used by all of
    our front ends, we strip off an ending of a period followed by
@@ -1903,8 +1965,10 @@ wrapup_global_declarations (vec, len)
     {
       decl = vec[i];
 
-      /* We're not deferring this any longer.  */
-      DECL_DEFER_OUTPUT (decl) = 0;
+      /* We're not deferring this any longer.  Assignment is
+        conditional to avoid needlessly dirtying PCH pages. */
+      if (DECL_DEFER_OUTPUT (decl) != 0)
+       DECL_DEFER_OUTPUT (decl) = 0;
 
       if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0)
        (*lang_hooks.finish_incomplete_decl) (decl);
@@ -2111,8 +2175,6 @@ pop_srcloc ()
 static void
 compile_file ()
 {
-  tree globals;
-
   /* Initialize yet another pass.  */
 
   init_final (main_input_filename);
@@ -2135,25 +2197,7 @@ compile_file ()
   if (flag_syntax_only)
     return;
 
-  globals = (*lang_hooks.decls.getdecls) ();
-
-  /* Really define vars that have had only a tentative definition.
-     Really output inline functions that must actually be callable
-     and have not been output so far.  */
-
-  {
-    int len = list_length (globals);
-    tree *vec = (tree *) xmalloc (sizeof (tree) * len);
-    int i;
-    tree decl;
-
-    /* Process the decls in reverse order--earliest first.
-       Put them into VEC from back to front, then take out from front.  */
-
-    for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
-      vec[len - i - 1] = decl;
-
-    wrapup_global_declarations (vec, len);
+  (*lang_hooks.decls.final_write_globals)();
 
     if (profile_arc_flag)
       /* This must occur after the loop to output deferred functions.
@@ -2161,12 +2205,6 @@ compile_file ()
          functions in this compilation unit were deferred.  */
       create_profiler ();
 
-    check_global_declarations (vec, len);
-
-    /* Clean up.  */
-    free (vec);
-  }
-
   /* Write out any pending weak symbol declarations.  */
 
   weak_finish ();
@@ -2443,12 +2481,16 @@ rest_of_compilation (decl)
                  goto exit_rest_of_compilation;
                }
            }
-         else
-           /* ??? Note that this has the effect of making it look
-                like "inline" was specified for a function if we choose
-                to inline it.  This isn't quite right, but it's
-                probably not worth the trouble to fix.  */
+         else {
+           /* ??? Note that we used to just make it look like if
+                the "inline" keyword was specified when we decide
+                to inline it (because of -finline-functions).
+                garloff@suse.de, 2002-04-24: Add another flag to
+                actually record this piece of information.  */
+           if (!DECL_INLINE (decl))
+              DID_INLINE_FUNC (decl) = 1;
            inlinable = DECL_INLINE (decl) = 1;
+         }
        }
 
       insns = get_insns ();
@@ -2588,9 +2630,12 @@ rest_of_compilation (decl)
   delete_unreachable_blocks ();
 
   /* Turn NOTE_INSN_PREDICTIONs into branch predictions.  */
-  timevar_push (TV_BRANCH_PROB);
-  note_prediction_to_br_prob ();
-  timevar_pop (TV_BRANCH_PROB);
+  if (flag_guess_branch_prob)
+    {
+      timevar_push (TV_BRANCH_PROB);
+      note_prediction_to_br_prob ();
+      timevar_pop (TV_BRANCH_PROB);
+    }
 
   /* We may have potential sibling or tail recursion sites.  Select one
      (of possibly multiple) methods of performing the call.  */
@@ -2671,21 +2716,25 @@ rest_of_compilation (decl)
   timevar_push (TV_JUMP);
   /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB.  Do this
      before jump optimization switches branch directions.  */
-  expected_value_to_br_prob ();
+  if (flag_guess_branch_prob)
+    expected_value_to_br_prob ();
 
   reg_scan (insns, max_reg_num (), 0);
   rebuild_jump_labels (insns);
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
+  delete_trivially_dead_insns (insns, max_reg_num ());
   if (rtl_dump_file)
     dump_flow_info (rtl_dump_file);
   cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP
               | (flag_thread_jumps ? CLEANUP_THREADING : 0));
 
-  /* CFG is no longer maintained up-to-date.  */
-  free_bb_for_insn ();
-  copy_loop_headers (insns);
+  if (optimize)
+    {
+      free_bb_for_insn ();
+      copy_loop_headers (insns);
+      find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
+    }
   purge_line_number_notes (insns);
-  find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
 
   timevar_pop (TV_JUMP);
   close_dump_file (DFI_jump, print_rtl, insns);
@@ -2763,7 +2812,8 @@ rest_of_compilation (decl)
     }
 
   timevar_push (TV_JUMP);
-  cleanup_cfg (optimize ? CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP: 0);
+  if (optimize)
+    cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
 
   /* Try to identify useless null pointer tests and delete them.  */
   if (flag_delete_null_pointer_checks)
@@ -2926,7 +2976,10 @@ rest_of_compilation (decl)
       /* CFG is no longer maintained up-to-date.  */
       free_bb_for_insn ();
 
-      do_unroll = flag_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
+      if (flag_unroll_loops)
+       do_unroll = 0;          /* Having two unrollers is useless.  */
+      else
+       do_unroll = flag_old_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
       do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
       if (flag_rerun_loop_opt)
        {
@@ -2991,8 +3044,9 @@ rest_of_compilation (decl)
   open_dump_file (DFI_cfg, decl);
   if (rtl_dump_file)
     dump_flow_info (rtl_dump_file);
-  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
-              | (flag_thread_jumps ? CLEANUP_THREADING : 0));
+  if (optimize)
+    cleanup_cfg (CLEANUP_EXPENSIVE
+                | (flag_thread_jumps ? CLEANUP_THREADING : 0));
 
   /* It may make more sense to mark constant functions after dead code is
      eliminated by life_analysis, but we need to do it early, as -fprofile-arcs
@@ -3031,7 +3085,7 @@ rest_of_compilation (decl)
       close_dump_file (DFI_bp, print_rtl_with_bb, insns);
       timevar_pop (TV_BRANCH_PROB);
     }
-  if (optimize >= 0)
+  if (optimize > 0)
     {
       open_dump_file (DFI_ce1, decl);
       if (flag_if_conversion)
@@ -3066,7 +3120,9 @@ rest_of_compilation (decl)
   /* Perform loop optimalizations.  It might be better to do them a bit
      sooner, but we want the profile feedback to work more efficiently.  */
   if (optimize > 0
-      && flag_unswitch_loops)
+      && (flag_unswitch_loops
+         || flag_peel_loops
+         || flag_unroll_loops))
     {
       struct loops *loops;
       timevar_push (TV_LOOP);
@@ -3082,6 +3138,12 @@ rest_of_compilation (decl)
          if (flag_unswitch_loops)
            unswitch_loops (loops);
 
+         if (flag_peel_loops || flag_unroll_loops)
+           unroll_and_peel_loops (loops,
+               (flag_peel_loops ? UAP_PEEL : 0) |
+               (flag_unroll_loops ? UAP_UNROLL : 0) |
+               (flag_unroll_all_loops ? UAP_UNROLL_ALL : 0));
+
          loop_optimizer_finalize (loops, rtl_dump_file);
        }
 
@@ -3408,10 +3470,13 @@ rest_of_compilation (decl)
 #endif
 
   /* If optimizing, then go ahead and split insns now.  */
+#ifndef STACK_REGS
   if (optimize > 0)
+#endif
     split_all_insns (0);
 
-  cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
+  if (optimize)
+    cleanup_cfg (CLEANUP_EXPENSIVE);
 
   /* On some machines, the prologue and epilogue code, or parts thereof,
      can be represented as RTL.  Doing so lets us schedule insns between
@@ -3469,6 +3534,28 @@ rest_of_compilation (decl)
       timevar_pop (TV_RENAME_REGISTERS);
     }
 
+  if (optimize > 0)
+    {
+      timevar_push (TV_REORDER_BLOCKS);
+      open_dump_file (DFI_bbro, decl);
+
+      /* Last attempt to optimize CFG, as scheduling, peepholing and insn
+        splitting possibly introduced more crossjumping opportunities. */
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
+                  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
+
+      if (flag_sched2_use_traces && flag_schedule_insns_after_reload)
+        tracer ();
+      if (flag_reorder_blocks)
+       reorder_basic_blocks ();
+      if (flag_reorder_blocks
+         || (flag_sched2_use_traces && flag_schedule_insns_after_reload))
+         cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
+
+      close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
+      timevar_pop (TV_REORDER_BLOCKS);
+    }
+
   if (flag_if_conversion2)
     {
       timevar_push (TV_IFCVT2);
@@ -3479,10 +3566,6 @@ rest_of_compilation (decl)
       close_dump_file (DFI_ce3, print_rtl_with_bb, insns);
       timevar_pop (TV_IFCVT2);
     }
-#ifdef STACK_REGS
-  if (optimize)
-    split_all_insns (1);
-#endif
 
 #ifdef INSN_SCHEDULING
   if (optimize > 0 && flag_schedule_insns_after_reload)
@@ -3495,7 +3578,16 @@ rest_of_compilation (decl)
 
       split_all_insns (1);
 
-      schedule_insns (rtl_dump_file);
+      if (flag_sched2_use_superblocks || flag_sched2_use_traces)
+       {
+         schedule_ebbs (rtl_dump_file);
+         /* No liveness updating code yet, but it should be easy to do.
+            reg-stack recompute the liveness when needed for now.  */
+         count_or_remove_death_notes (NULL, 1);
+         cleanup_cfg (CLEANUP_EXPENSIVE);
+       }
+      else
+        schedule_insns (rtl_dump_file);
 
       close_dump_file (DFI_sched2, print_rtl_with_bb, insns);
       timevar_pop (TV_SCHED2);
@@ -3513,33 +3605,22 @@ rest_of_compilation (decl)
   timevar_push (TV_REG_STACK);
   open_dump_file (DFI_stack, decl);
 
-  reg_to_stack (insns, rtl_dump_file);
-
-  close_dump_file (DFI_stack, print_rtl_with_bb, insns);
-  timevar_pop (TV_REG_STACK);
-
-  ggc_collect ();
-#endif
-  if (optimize > 0)
+  if (reg_to_stack (insns, rtl_dump_file) && optimize)
     {
-      timevar_push (TV_REORDER_BLOCKS);
-      open_dump_file (DFI_bbro, decl);
-
-      /* Last attempt to optimize CFG, as scheduling, peepholing and insn
-        splitting possibly introduced more crossjumping opportunities.
-        Except that we can't actually run crossjumping without running
-        another DCE pass, which we can't do after reg-stack.  */
-      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
-                  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
-      if (flag_reorder_blocks)
+      if (cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
+                      | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0))
+         && flag_reorder_blocks)
        {
          reorder_basic_blocks ();
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
        }
-
-      close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
-      timevar_pop (TV_REORDER_BLOCKS);
     }
+
+  close_dump_file (DFI_stack, print_rtl_with_bb, insns);
+  timevar_pop (TV_REG_STACK);
+
+  ggc_collect ();
+#endif
   compute_alignments ();
 
   /* CFG is no longer maintained up-to-date.  */
@@ -3953,6 +4034,9 @@ decode_d_option (arg)
       case 'D':        /* These are handled by the preprocessor.  */
       case 'I':
        break;
+      case 'H':
+       setup_core_dumping();
+       break;
 
       default:
        matched = 0;
@@ -4008,6 +4092,16 @@ decode_f_option (arg)
        read_integral_parameter (option_value, arg - 2,
                                 MAX_INLINE_INSNS);
       set_param_value ("max-inline-insns", val);
+      set_param_value ("max-inline-insns-single", val/2);
+      set_param_value ("max-inline-insns-auto", val/2);
+      set_param_value ("max-inline-insns-rtl", val);
+      if (val/4 < MIN_INLINE_INSNS)
+       {
+         if (val/4 > 10)
+           set_param_value ("min-inline-insns", val/4);
+         else
+           set_param_value ("min-inline-insns", 10);
+       }
     }
   else if ((option_value = skip_leading_substring (arg, "tls-model=")))
     {
@@ -4375,7 +4469,7 @@ independent_decode_option (argc, argv)
 
          if (argv[1][0])
            dump_base_name = argv[1];
-         
+
          return 2;
        }
       else
@@ -4455,7 +4549,7 @@ independent_decode_option (argc, argv)
 
          if (argv[1][0])
            aux_base_name = argv[1];
-         
+
          return 2;
        }
       else if (!strcmp (arg, "auxbase-strip"))
@@ -4469,7 +4563,7 @@ independent_decode_option (argc, argv)
              if (argv[1][0])
                aux_base_name = argv[1];
            }
-         
+
          return 2;
        }
       else
@@ -4586,6 +4680,9 @@ print_version (file, indent)
           , indent, *indent != 0 ? " " : "",
           lang_hooks.name, version_string, TARGET_NAME,
           indent, __VERSION__);
+  fnotice (file, "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n",
+          indent, *indent != 0 ? " " : "",
+          PARAM_VALUE (GGC_MIN_EXPAND), PARAM_VALUE (GGC_MIN_HEAPSIZE));
 }
 
 /* Print an option value and return the adjusted position in the line.
@@ -4829,6 +4926,9 @@ parse_options_and_default_flags (argc, argv)
   /* Register the language-independent parameters.  */
   add_params (lang_independent_params, LAST_PARAM);
 
+  /* This must be done after add_params but before argument processing.  */
+  init_ggc_heuristics();
+
   /* Perform language-specific options initialization.  */
   (*lang_hooks.init_options) ();
 
@@ -5061,6 +5161,19 @@ process_options ()
   OVERRIDE_OPTIONS;
 #endif
 
+  /* Set aux_base_name if not already set.  */
+  if (aux_base_name)
+    ;
+  else if (filename)
+    {
+      char *name = xstrdup (lbasename (filename));
+      
+      strip_off_ending (name, strlen (name));
+      aux_base_name = name;
+    }
+  else
+    aux_base_name = "gccaux";
+
   /* Set up the align_*_log variables, defaulting them to 1 if they
      were still unset.  */
   if (align_loops <= 0) align_loops = 1;
@@ -5082,21 +5195,38 @@ process_options ()
      be done.  */
   if (flag_unroll_all_loops)
     flag_unroll_loops = 1;
-  /* Loop unrolling requires that strength_reduction be on also.  Silently
+
+  if (flag_unroll_loops)
+    {
+      flag_old_unroll_loops = 0;
+      flag_old_unroll_all_loops = 0;
+    }
+
+  if (flag_old_unroll_all_loops)
+    flag_old_unroll_loops = 1;
+
+  /* Old loop unrolling requires that strength_reduction be on also.  Silently
      turn on strength reduction here if it isn't already on.  Also, the loop
      unrolling code assumes that cse will be run after loop, so that must
      be turned on also.  */
-  if (flag_unroll_loops)
+  if (flag_old_unroll_loops)
     {
       flag_strength_reduce = 1;
       flag_rerun_cse_after_loop = 1;
     }
+  if (flag_unroll_loops || flag_peel_loops)
+    flag_rerun_cse_after_loop = 1;
 
   if (flag_non_call_exceptions)
     flag_asynchronous_unwind_tables = 1;
   if (flag_asynchronous_unwind_tables)
     flag_unwind_tables = 1;
 
+  /* Disable unit-at-a-time mode for frontends not supporting callgraph
+     interface.  */
+  if (flag_unit_at_a_time && ! lang_hooks.callgraph.expand_function)
+    flag_unit_at_a_time = 0;
+
   /* Warn about options that are not supported on this machine.  */
 #ifndef INSN_SCHEDULING
   if (flag_schedule_insns || flag_schedule_insns_after_reload)
@@ -5131,7 +5261,7 @@ process_options ()
        print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
     }
 
-  if (! quiet_flag)
+  if (! quiet_flag  || flag_detailed_statistics)
     time_report = 1;
 
   if (flag_syntax_only)
@@ -5267,7 +5397,7 @@ lang_dependent_init (name)
 {
   if (dump_base_name == 0)
     dump_base_name = name ? name : "gccdump";
-  
+
   /* Front-end initialization.  This hook can assume that GC,
      identifier hashes etc. are set up, but debug initialization is
      not done yet.  This routine must return the original filename
@@ -5276,8 +5406,6 @@ lang_dependent_init (name)
   if (name == NULL)
     return 0;
 
-  /* Is this duplication necessary?  */
-  name = ggc_strdup (name);
   main_input_filename = input_filename = name;
   init_asm_output (name);
 
@@ -5372,31 +5500,9 @@ finalize ()
 \f
 /* Initialize the compiler, and compile the input file.  */
 static void
-do_compile ()
+do_compile (no_backend)
+     int no_backend;
 {
-  /* All command line options have been parsed; allow the front end to
-     perform consistency checks, etc.  */
-  bool no_backend = (*lang_hooks.post_options) ();
-
-  /* The bulk of command line switch processing.  */
-  process_options ();
-
-  /* If an error has already occurred, give up.  */
-  if (errorcount)
-    return;
-
-  if (aux_base_name)
-    /*NOP*/;
-  else if (filename)
-    {
-      char *name = xstrdup (lbasename (filename));
-      
-      aux_base_name = name;
-      strip_off_ending (name, strlen (name));
-    }
-  else
-    aux_base_name = "gccaux";
-
   /* We cannot start timing until after options are processed since that
      says if we run timers or not.  */
   init_timevar ();
@@ -5438,7 +5544,18 @@ toplev_main (argc, argv)
 
   /* Exit early if we can (e.g. -help).  */
   if (!exit_after_options)
-    do_compile ();
+    {
+      /* All command line options have been parsed; allow the front
+        end to perform consistency checks, etc.  */
+      bool no_backend = (*lang_hooks.post_options) ();
+
+      /* The bulk of command line switch processing.  */
+      process_options ();
+
+      /* Don't do any more if an error has already occurred.  */
+      if (!errorcount)
+       do_compile (no_backend);
+    }
 
   if (errorcount || sorrycount)
     return (FATAL_EXIT_CODE);