OSDN Git Service

* c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index ae068d4..7cfb29e 100644 (file)
@@ -75,6 +75,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "cfglayout.h"
 #include "cfgloop.h"
 #include "hosthooks.h"
+#include "cgraph.h"
 
 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
 #include "dwarf2out.h"
@@ -123,6 +124,7 @@ static int decode_f_option PARAMS ((const char *));
 static int decode_W_option PARAMS ((const char *));
 static int decode_g_option PARAMS ((const char *));
 static unsigned int independent_decode_option PARAMS ((int, char **));
+static void set_Wextra PARAMS ((int));
 
 static void print_version PARAMS ((FILE *, const char *));
 static int print_single_switch PARAMS ((FILE *, int, int, const char *,
@@ -134,6 +136,9 @@ static void print_switch_values PARAMS ((FILE *, int, int, const char *,
 /* Nonzero to dump debug info whilst parsing (-dy option).  */
 static int set_yydebug;
 
+/* True if we don't need a backend (e.g. preprocessing only).  */
+static bool no_backend;
+
 /* Length of line when printing switch values.  */
 #define MAX_LINE 75
 
@@ -145,20 +150,15 @@ const char *progname;
 int save_argc;
 char **save_argv;
 \f
-/* Name of current original source file (what was input to cpp).
-   This comes from each #-command in the actual input.  */
-
-const char *input_filename;
-
 /* Name of top-level original source file (what was input to cpp).
    This comes from the #-command at the beginning of the actual input.
    If there isn't any there, then this is the cc1 input file name.  */
 
 const char *main_input_filename;
 
-/* Current line number in real source file.  */
+/* Current position in real source file.  */
 
-int lineno;
+location_t input_location;
 
 /* Nonzero if it is unsafe to create any new pseudo registers.  */
 int no_new_pseudos;
@@ -176,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,8 +253,8 @@ enum dump_file_index
   DFI_flow2,
   DFI_peephole2,
   DFI_rnreg,
-  DFI_ce3,
   DFI_bbro,
+  DFI_ce3,
   DFI_sched2,
   DFI_stack,
   DFI_mach,
@@ -304,8 +304,8 @@ static struct dump_file_info dump_file[DFI_MAX] =
   { "flow2",   'w', 1, 0, 0 },
   { "peephole2", 'z', 1, 0, 0 },
   { "rnreg",   'n', 1, 0, 0 },
-  { "ce3",     'E', 1, 0, 0 },
   { "bbro",    'B', 1, 0, 0 },
+  { "ce3",     'E', 1, 0, 0 },
   { "sched2",  'R', 1, 0, 0 },
   { "stack",   'k', 1, 0, 0 },
   { "mach",    'M', 1, 0, 0 },
@@ -321,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.  */
@@ -329,7 +329,7 @@ enum graph_dump_types graph_dump_format;
 char *asm_file_name;
 
 /* Value of the -G xx switch, and whether it was passed or not.  */
-int g_switch_value;
+unsigned HOST_WIDE_INT g_switch_value;
 int g_switch_set;
 
 /* Type(s) of debugging information we are producing (if any).
@@ -378,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;
@@ -423,7 +427,7 @@ int quiet_flag = 0;
 
 /* Print times taken by the various passes.  -ftime-report.  */
 
-int time_report = 0;
+static int time_report = 0;
 
 /* Print memory still in use at end of compilation (which may have little
    to do with peak memory consumption).  -fmem-report.  */
@@ -999,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,
@@ -1102,9 +1108,9 @@ static const lang_independent_options f_options[] =
   {"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") },
+   N_("If scheduling post reload, do superblock scheduling") },
   {"sched2-use-traces", &flag_sched2_use_traces, 1,
-   N_("If scheduling post reload, do trace sheduling") },
+   N_("If scheduling post reload, do trace scheduling") },
   {"branch-count-reg",&flag_branch_on_count_reg, 1,
    N_("Replace add,compare,branch with branch on count reg") },
   {"pic", &flag_pic, 1,
@@ -1143,7 +1149,7 @@ static const lang_independent_options f_options[] =
   {"data-sections", &flag_data_sections, 1,
    N_("place data items into their own section") },
   {"verbose-asm", &flag_verbose_asm, 1,
-   N_("Add extra commentry to assembler output") },
+   N_("Add extra commentary to assembler output") },
   {"gnu-linker", &flag_gnu_linker, 1,
    N_("Output GNU ld formatted global initializers") },
   {"regmove", &flag_regmove, 1,
@@ -1171,7 +1177,7 @@ static const lang_independent_options f_options[] =
   {"align-functions", &align_functions, 0,
    N_("Align the start of functions") },
   {"merge-constants", &flag_merge_constants, 1,
-   N_("Attempt to merge identical constants accross compilation units") },
+   N_("Attempt to merge identical constants across compilation units") },
   {"merge-all-constants", &flag_merge_constants, 2,
    N_("Attempt to merge identical constants and constant variables") },
   {"dump-unnumbered", &flag_dump_unnumbered, 1,
@@ -1421,6 +1427,7 @@ static const struct
   const char *const prefix;
   const char **const variable;
   const char *const description;
+  const char *const value;
 }
 target_options[] = TARGET_OPTIONS;
 #endif
@@ -1451,6 +1458,9 @@ int warn_unused_parameter;
 int warn_unused_variable;
 int warn_unused_value;
 
+/* Used for cooperation between set_Wunused and set_Wextra.  */
+static int maybe_warn_unused_parameter;
+
 /* Nonzero to warn about code which is never reached.  */
 
 int warn_notreached;
@@ -1574,8 +1584,6 @@ static const lang_independent_options W_options[] =
    N_("Warn when an optimization pass is disabled") },
   {"deprecated-declarations", &warn_deprecated_decl, 1,
    N_("Warn about uses of __attribute__((deprecated)) declarations") },
-  {"extra", &extra_warnings, 1,
-   N_("Print extra (possibly unwanted) warnings") },
   {"missing-noreturn", &warn_missing_noreturn, 1,
    N_("Warn about functions which might be candidates for attribute noreturn") },
   {"strict-aliasing", &warn_strict_aliasing, 1,
@@ -1588,17 +1596,34 @@ set_Wunused (setting)
 {
   warn_unused_function = setting;
   warn_unused_label = setting;
-  /* Unused function parameter warnings are reported when either ``-W
-     -Wunused'' or ``-Wunused-parameter'' is specified.  Differentiate
-     -Wunused by setting WARN_UNUSED_PARAMETER to -1.  */
-  if (!setting)
-    warn_unused_parameter = 0;
-  else if (!warn_unused_parameter)
-    warn_unused_parameter = -1;
+  /* Unused function parameter warnings are reported when either
+     ``-Wextra -Wunused'' or ``-Wunused-parameter'' is specified.
+     Thus, if -Wextra has already been seen, set warn_unused_parameter;
+     otherwise set maybe_warn_extra_parameter, which will be picked up
+     by set_Wextra.  */
+  maybe_warn_unused_parameter = setting;
+  warn_unused_parameter = (setting && extra_warnings);
   warn_unused_variable = setting;
   warn_unused_value = setting;
 }
 
+static void
+set_Wextra (setting)
+     int setting;
+{
+  extra_warnings = setting;
+  warn_unused_value = setting;
+  warn_unused_parameter = (setting && maybe_warn_unused_parameter);
+
+  /* We save the value of warn_uninitialized, since if they put
+     -Wuninitialized on the command line, we need to generate a
+     warning about not using it without also specifying -O.  */
+  if (setting == 0)
+    warn_uninitialized = 0;
+  else if (warn_uninitialized != 1)
+    warn_uninitialized = 2;
+}
+
 /* The following routines are useful in setting all the flags that
    -ffast-math and -fno-fast-math imply.  */
 
@@ -1656,7 +1681,7 @@ read_integral_parameter (p, pname, defval)
   if (*endp != 0)
     {
       if (pname != 0)
-       error ("invalid option `%s'", pname);
+       error ("invalid option argument `%s'", pname);
       return defval;
     }
 
@@ -1739,10 +1764,10 @@ setup_core_dumping ()
   {
     struct rlimit rlim;
     if (getrlimit (RLIMIT_CORE, &rlim) != 0)
-      fatal_io_error ("getting core file size maximum limit");
+      fatal_error ("getting core file size maximum limit: %m");
     rlim.rlim_cur = rlim.rlim_max;
     if (setrlimit (RLIMIT_CORE, &rlim) != 0)
-      fatal_io_error ("setting core file size limit to maximum");
+      fatal_error ("setting core file size limit to maximum: %m");
   }
 #endif
   diagnostic_abort_on_error (global_dc);
@@ -1888,7 +1913,7 @@ open_dump_file (index, decl)
 
   rtl_dump_file = fopen (dump_name, open_arg);
   if (rtl_dump_file == NULL)
-    fatal_io_error ("can't open %s", dump_name);
+    fatal_error ("can't open %s: %m", dump_name);
 
   free (dump_name);
 
@@ -1960,7 +1985,7 @@ wrapup_global_declarations (vec, len)
       decl = vec[i];
 
       /* We're not deferring this any longer.  Assignment is
-        conditional to avoid needlessly dirtying PCH pages. */
+        conditional to avoid needlessly dirtying PCH pages.  */
       if (DECL_DEFER_OUTPUT (decl) != 0)
        DECL_DEFER_OUTPUT (decl) = 0;
 
@@ -2101,6 +2126,8 @@ check_global_declarations (vec, len)
          && ! TREE_USED (DECL_NAME (decl))
          && ! DECL_EXTERNAL (decl)
          && ! TREE_PUBLIC (decl)
+         /* A volatile variable might be used in some non-obvious way.  */
+         && ! TREE_THIS_VOLATILE (decl)
          /* Global register variables must be declared to reserve them.  */
          && ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
          /* Otherwise, ask the language.  */
@@ -2118,9 +2145,9 @@ check_global_declarations (vec, len)
     }
 }
 
-/* Save the current INPUT_FILENAME and LINENO on the top entry in the
+/* Save the current INPUT_LOCATION on the top entry in the
    INPUT_FILE_STACK.  Push a new entry for FILE and LINE, and set the
-   INPUT_FILENAME and LINENO accordingly.  */
+   INPUT_LOCATION accordingly.  */
 
 void
 push_srcloc (file, line)
@@ -2130,22 +2157,20 @@ push_srcloc (file, line)
   struct file_stack *fs;
 
   if (input_file_stack)
-    {
-      input_file_stack->name = input_filename;
-      input_file_stack->line = lineno;
-    }
+    input_file_stack->location = input_location;
 
   fs = (struct file_stack *) xmalloc (sizeof (struct file_stack));
-  fs->name = input_filename = file;
-  fs->line = lineno = line;
+  input_filename = file;
+  input_line = line;
+  fs->location = input_location;
   fs->next = input_file_stack;
   input_file_stack = fs;
   input_file_stack_tick++;
 }
 
 /* Pop the top entry off the stack of presently open source files.
-   Restore the INPUT_FILENAME and LINENO from the new topmost entry on
-   the stack.  */
+   Restore the INPUT_LOCATION from the new topmost entry on the
+   stack.  */
 
 void
 pop_srcloc ()
@@ -2156,11 +2181,14 @@ pop_srcloc ()
   input_file_stack = fs->next;
   free (fs);
   input_file_stack_tick++;
-  /* The initial source file is never popped.  */
-  if (!input_file_stack)
-    abort ();
-  input_filename = input_file_stack->name;
-  lineno = input_file_stack->line;
+
+  if (input_file_stack)
+    input_location = input_file_stack->location;
+  else
+    {
+      input_filename = NULL;
+      input_line = 0;
+    }
 }
 
 /* Compile an entire translation unit.  Write a file of assembly
@@ -2172,7 +2200,7 @@ compile_file ()
   /* Initialize yet another pass.  */
 
   init_final (main_input_filename);
-  init_branch_prob (aux_base_name);
+  coverage_init (aux_base_name);
 
   timevar_push (TV_PARSE);
 
@@ -2193,11 +2221,10 @@ compile_file ()
 
   (*lang_hooks.decls.final_write_globals)();
 
-    if (profile_arc_flag)
-      /* This must occur after the loop to output deferred functions.
-         Else the profiler initializer would not be emitted if all the
-         functions in this compilation unit were deferred.  */
-      create_profiler ();
+  /* This must occur after the loop to output deferred functions.
+     Else the coverage initializer would not be emitted if all the
+     functions in this compilation unit were deferred.  */
+  coverage_finish ();
 
   /* Write out any pending weak symbol declarations.  */
 
@@ -2475,12 +2502,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 ();
@@ -2508,6 +2539,7 @@ rest_of_compilation (decl)
 
       if (inlinable
          || (DECL_INLINE (decl)
+             && flag_inline_functions
              && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
                   && ! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
                   && ! flag_keep_inline_functions)
@@ -2619,6 +2651,10 @@ rest_of_compilation (decl)
 
   delete_unreachable_blocks ();
 
+  /* We have to issue these warnings now already, because CFG cleanups
+     further down may destroy the required information.  */
+  check_function_return_warnings ();
+
   /* Turn NOTE_INSN_PREDICTIONs into branch predictions.  */
   if (flag_guess_branch_prob)
     {
@@ -2802,7 +2838,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)
@@ -2903,6 +2940,10 @@ rest_of_compilation (decl)
       save_cfj = flag_cse_follow_jumps;
       flag_cse_skip_blocks = flag_cse_follow_jumps = 0;
 
+      /* Instantiate any remaining CONSTANT_P_RTX nodes.  */
+      if (current_function_calls_constant_p)
+       purge_builtin_constant_p ();
+
       /* If -fexpensive-optimizations, re-run CSE to clean up things done
         by gcse.  */
       if (flag_expensive_optimizations)
@@ -2948,10 +2989,6 @@ rest_of_compilation (decl)
 #endif
     }
 
-  /* Instantiate any remaining CONSTANT_P_RTX nodes.  */
-  if (optimize > 0 && flag_gcse && current_function_calls_constant_p)
-    purge_builtin_constant_p ();
-
   /* Move constant computations out of loops.  */
 
   if (optimize > 0 && flag_loop_optimize)
@@ -3033,8 +3070,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
@@ -3049,13 +3087,14 @@ rest_of_compilation (decl)
   close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
 
   /* Do branch profiling and static profile estimation passes.  */
-  if (optimize > 0 || cfun->arc_profile || flag_branch_probabilities)
+  if (optimize > 0
+      || profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
     {
       struct loops loops;
 
       timevar_push (TV_BRANCH_PROB);
       open_dump_file (DFI_bp, decl);
-      if (cfun->arc_profile || flag_branch_probabilities)
+      if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
        branch_prob ();
 
       /* Discover and record the loop depth at the head of each basic
@@ -3174,8 +3213,6 @@ rest_of_compilation (decl)
   open_dump_file (DFI_life, decl);
   regclass_init ();
 
-  check_function_return_warnings ();
-
 #ifdef ENABLE_CHECKING
   verify_flow_info ();
 #endif
@@ -3185,9 +3222,7 @@ rest_of_compilation (decl)
                 | (flag_thread_jumps ? CLEANUP_THREADING : 0));
   timevar_pop (TV_FLOW);
 
-  no_new_pseudos = 1;
-
-  if (warn_uninitialized || extra_warnings)
+  if (warn_uninitialized)
     {
       uninitialized_vars_warning (DECL_INITIAL (decl));
       if (extra_warnings)
@@ -3196,17 +3231,19 @@ rest_of_compilation (decl)
 
   if (optimize)
     {
-      clear_bb_flags ();
       if (!flag_new_regalloc && initialize_uninitialized_subregs ())
        {
-         /* Insns were inserted, so things might look a bit different.  */
+         /* Insns were inserted, and possibly pseudos created, so
+            things might look a bit different.  */
          insns = get_insns ();
-         update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
-                                           PROP_LOG_LINKS | PROP_REG_INFO
-                                           | PROP_DEATH_NOTES);
+         allocate_reg_life_data ();
+         update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
+                           PROP_LOG_LINKS | PROP_REG_INFO | PROP_DEATH_NOTES);
        }
     }
 
+  no_new_pseudos = 1;
+
   close_dump_file (DFI_life, print_rtl_with_bb, insns);
 
   ggc_collect ();
@@ -3458,10 +3495,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
@@ -3525,7 +3565,7 @@ rest_of_compilation (decl)
       open_dump_file (DFI_bbro, decl);
 
       /* Last attempt to optimize CFG, as scheduling, peepholing and insn
-        splitting possibly introduced more crossjumping opportunities. */
+        splitting possibly introduced more crossjumping opportunities.  */
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
                   | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
 
@@ -3551,10 +3591,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)
@@ -3616,17 +3652,18 @@ rest_of_compilation (decl)
   free_bb_for_insn ();
 
   /* If a machine dependent reorganization is needed, call it.  */
-#ifdef MACHINE_DEPENDENT_REORG
-  timevar_push (TV_MACH_DEP);
-  open_dump_file (DFI_mach, decl);
+  if (targetm.machine_dependent_reorg != 0)
+    {
+      timevar_push (TV_MACH_DEP);
+      open_dump_file (DFI_mach, decl);
 
-  MACHINE_DEPENDENT_REORG (insns);
+      (*targetm.machine_dependent_reorg) ();
 
-  close_dump_file (DFI_mach, print_rtl, insns);
-  timevar_pop (TV_MACH_DEP);
+      close_dump_file (DFI_mach, print_rtl, insns);
+      timevar_pop (TV_MACH_DEP);
 
-  ggc_collect ();
-#endif
+      ggc_collect ();
+    }
 
   purge_line_number_notes (insns);
   cleanup_barriers ();
@@ -3734,6 +3771,8 @@ rest_of_compilation (decl)
 
  exit_rest_of_compilation:
 
+  coverage_end_function ();
+  
   /* In case the function was not output,
      don't leave any temporary anonymous types
      queued up for sdb output.  */
@@ -3760,6 +3799,16 @@ rest_of_compilation (decl)
 
   timevar_pop (TV_FINAL);
 
+  if ((*targetm.binds_local_p) (current_function_decl))
+    {
+      int pref = cfun->preferred_stack_boundary;
+      if (cfun->recursive_call_emit
+          && cfun->stack_alignment_needed > cfun->preferred_stack_boundary)
+       pref = cfun->stack_alignment_needed;
+      cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary
+        = pref;
+    }
+
   /* Make sure volatile mem refs aren't considered valid operands for
      arithmetic insns.  We must call this here if this is a nested inline
      function, since the above code leaves us in the init_recog state
@@ -3802,6 +3851,10 @@ display_help ()
   printf (_("  -fmessage-length=<number> Limits diagnostics messages lengths to <number> characters per line.  0 suppresses line-wrapping\n"));
   printf (_("  -fdiagnostics-show-location=[once | every-line] Indicates how often source location information should be emitted, as prefix, at the beginning of diagnostics when line-wrapping\n"));
   printf (_("  -ftls-model=[global-dynamic | local-dynamic | initial-exec | local-exec] Indicates the default thread-local storage code generation model\n"));
+  printf (_("  -fstack-limit-register=<register>  Trap if the stack goes past <register>\n"));
+  printf (_("  -fstack-limit-symbol=<name>  Trap if the stack goes past symbol <name>\n"));
+  printf (_("  -frandom-seed=<string>  Make compile reproducible using <string>\n"));
+  
 
   for (i = ARRAY_SIZE (f_options); i--;)
     {
@@ -3838,6 +3891,7 @@ display_help ()
                W_options[i].string, _(description));
     }
 
+  printf (_("  -Wextra                 Print extra (possibly unwanted) warnings\n"));
   printf (_("  -Wunused                Enable unused warnings\n"));
   printf (_("  -Wlarger-than-<number>  Warn if an object is larger than <number> bytes\n"));
   printf (_("  -p                      Enable function profiling\n"));
@@ -4081,6 +4135,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=")))
     {
@@ -4149,6 +4213,10 @@ decode_f_option (arg)
     }
   else if (!strcmp (arg, "no-stack-limit"))
     stack_limit_rtx = NULL_RTX;
+  else if ((option_value = skip_leading_substring (arg, "random-seed=")))
+    flag_random_seed = option_value;
+  else if (!strcmp (arg, "no-random-seed"))
+    flag_random_seed = NULL;
   else if (!strcmp (arg, "preprocessed"))
     /* Recognize this switch but do nothing.  This prevents warnings
        about an unrecognized switch if cpplib has not been linked in.  */
@@ -4206,11 +4274,11 @@ decode_W_option (arg)
     }
   else if (!strcmp (arg, "extra"))
     {
-      /* We save the value of warn_uninitialized, since if they put
-        -Wuninitialized on the command line, we need to generate a
-        warning about not using it without also specifying -O.  */
-      if (warn_uninitialized != 1)
-       warn_uninitialized = 2;
+      set_Wextra (1);
+    }
+  else if (!strcmp (arg, "no-extra"))
+    {
+      set_Wextra (0);
     }
   else
     return 0;
@@ -4218,6 +4286,12 @@ decode_W_option (arg)
   return 1;
 }
 
+/* Indexed by enum debug_info_type.  */
+const char *const debug_type_names[] =
+{
+  "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff", "vms"
+};
+
 /* Parse a -g... command line switch.  ARG is the value after the -g.
    It is safe to access 'ARG - 2' to generate the full switch name.
    Return the number of strings consumed.  */
@@ -4237,11 +4311,6 @@ decode_g_option (arg)
      -g and -ggdb don't explicitly set the debugging format so
      -gdwarf -g3 is equivalent to -gdwarf3.  */
   static int type_explicitly_set_p = 0;
-  /* Indexed by enum debug_info_type.  */
-  static const char *const debug_type_names[] =
-  {
-    "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff", "vms"
-  };
 
   /* The maximum admissible debug level value.  */
   static const unsigned max_debug_level = 3;
@@ -4370,18 +4439,21 @@ independent_decode_option (argc, argv)
     {
       display_help ();
       exit_after_options = 1;
+      return 1;
     }
 
   if (!strcmp (arg, "-target-help"))
     {
       display_target_options ();
       exit_after_options = 1;
+      return 1;
     }
 
   if (!strcmp (arg, "-version"))
     {
       print_version (stderr, "");
       exit_after_options = 1;
+      return 1;
     }
 
   /* Handle '--param <name>=<value>'.  */
@@ -4418,9 +4490,6 @@ independent_decode_option (argc, argv)
       return 2;
     }
 
-  if (*arg == 'Y')
-    arg++;
-
   switch (*arg)
     {
     default:
@@ -4488,15 +4557,9 @@ independent_decode_option (argc, argv)
       break;
 
     case 'W':
+      /* For backward compatibility, -W is the same as -Wextra.  */
       if (arg[1] == 0)
-       {
-         extra_warnings = 1;
-         /* We save the value of warn_uninitialized, since if they put
-            -Wuninitialized on the command line, we need to generate a
-            warning about not using it without also specifying -O.  */
-         if (warn_uninitialized != 1)
-           warn_uninitialized = 2;
-       }
+       set_Wextra (1);
       else
        return decode_W_option (arg + 1);
       break;
@@ -4626,10 +4689,21 @@ set_target_switch (name)
     for (j = 0; j < ARRAY_SIZE (target_options); j++)
       {
        int len = strlen (target_options[j].prefix);
-       if (!strncmp (target_options[j].prefix, name, len))
+       if (target_options[j].value)
          {
-           *target_options[j].variable = name + len;
-           valid_target_option = 1;
+           if (!strcmp (target_options[j].prefix, name))
+             {
+               *target_options[j].variable = target_options[j].value;
+               valid_target_option = 1;
+             }
+         }
+       else
+         {
+           if (!strncmp (target_options[j].prefix, name, len))
+             {
+               *target_options[j].variable = name + len;
+               valid_target_option = 1;
+             }
          }
       }
 #endif
@@ -4647,8 +4721,6 @@ print_version (file, indent)
      FILE *file;
      const char *indent;
 {
-  fnotice (file, "GGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n",
-          PARAM_VALUE (GGC_MIN_EXPAND), PARAM_VALUE (GGC_MIN_HEAPSIZE));
 #ifndef __VERSION__
 #define __VERSION__ "[?]"
 #endif
@@ -4661,6 +4733,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.
@@ -4707,6 +4782,12 @@ print_switch_values (file, pos, max, indent, sep, term)
   size_t j;
   char **p;
 
+  /* Fill in the -frandom-seed option, if the user didn't pass it, so
+     that it can be printed below.  This helps reproducibility.  Of
+     course, the string may never be used, but we can't tell that at
+     this point in the compile.  */
+  default_flag_random_seed ();
+
   /* Print the options as passed.  */
 
   pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
@@ -4798,7 +4879,7 @@ init_asm_output (name)
       else
        asm_out_file = fopen (asm_file_name, "w+");
       if (asm_out_file == 0)
-       fatal_io_error ("can't open %s for writing", asm_file_name);
+       fatal_error ("can't open %s for writing: %m", asm_file_name);
     }
 
 #ifdef IO_BUFFER_SIZE
@@ -4995,6 +5076,7 @@ parse_options_and_default_flags (argc, argv)
       flag_inline_functions = 1;
       flag_rename_registers = 1;
       flag_unswitch_loops = 1;
+      flag_unit_at_a_time = 1;
     }
 
   if (optimize < 2 || optimize_size)
@@ -5134,11 +5216,31 @@ parse_options_and_default_flags (argc, argv)
 static void
 process_options ()
 {
+  /* Allow the front end to perform consistency checks and do further
+     initialization based on the command line options.  This hook also
+     sets the original filename if appropriate (e.g. foo.i -> foo.c)
+     so we can correctly initialize debug output.  */
+  no_backend = (*lang_hooks.post_options) (&filename);
+  main_input_filename = input_filename = filename;
+
 #ifdef OVERRIDE_OPTIONS
   /* Some machines may reject certain combinations of 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;
@@ -5226,9 +5328,6 @@ process_options ()
        print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
     }
 
-  if (! quiet_flag  || flag_detailed_statistics)
-    time_report = 1;
-
   if (flag_syntax_only)
     {
       write_symbols = NO_DEBUG;
@@ -5269,7 +5368,7 @@ process_options ()
     {
       aux_info_file = fopen (aux_info_file_name, "w");
       if (aux_info_file == 0)
-       fatal_io_error ("can't open %s", aux_info_file_name);
+       fatal_error ("can't open %s: %m", aux_info_file_name);
     }
 
   if (! targetm.have_named_sections)
@@ -5363,17 +5462,10 @@ 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
-     (e.g. foo.i -> foo.c) so can correctly initialize debug output.  */
-  name = (*lang_hooks.init) (name);
-  if (name == NULL)
+  /* Other front-end initialization.  */
+  if ((*lang_hooks.init) () == 0)
     return 0;
 
-  /* Is this duplication necessary?  */
-  name = ggc_strdup (name);
-  main_input_filename = input_filename = name;
   init_asm_output (name);
 
   /* These create various _DECL nodes, so need to be called after the
@@ -5428,9 +5520,9 @@ finalize ()
   if (asm_out_file)
     {
       if (ferror (asm_out_file) != 0)
-       fatal_io_error ("error writing to %s", asm_file_name);
+       fatal_error ("error writing to %s: %m", asm_file_name);
       if (fclose (asm_out_file) != 0)
-       fatal_io_error ("error closing %s", asm_file_name);
+       fatal_error ("error closing %s: %m", asm_file_name);
     }
 
   /* Do whatever is necessary to finish printing the graphs.  */
@@ -5469,43 +5561,27 @@ finalize ()
 static void
 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) ();
+  /* Initialize timing first.  The C front ends read the main file in
+     the post_options hook, and C++ does file timings.  */
+  if (time_report || !quiet_flag  || flag_detailed_statistics)
+    timevar_init ();
+  timevar_start (TV_TOTAL);
 
-  /* 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)
+  /* Don't do any more if an error has already occurred.  */
+  if (!errorcount)
     {
-      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 ();
-  timevar_start (TV_TOTAL);
-
-  /* Set up the back-end if requested.  */
-  if (!no_backend)
-    backend_init ();
+      /* Set up the back-end if requested.  */
+      if (!no_backend)
+       backend_init ();
 
-  /* Language-dependent initialization.  Returns true on success.  */
-  if (lang_dependent_init (filename))
-    compile_file ();
+      /* Language-dependent initialization.  Returns true on success.  */
+      if (lang_dependent_init (filename))
+       compile_file ();
 
-  finalize ();
+      finalize ();
+    }
 
   /* Stop timing and print the times.  */
   timevar_stop (TV_TOTAL);