OSDN Git Service

* config/s390/s390.c (s390_emit_epilogue): Always restore registers
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index 11c5546..07dc649 100644 (file)
@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #undef FFS  /* Some systems define this in param.h.  */
 #include "system.h"
 #include <signal.h>
-#include <setjmp.h>
 
 #ifdef HAVE_SYS_RESOURCE_H
 # include <sys/resource.h>
@@ -92,29 +91,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "halfpic.h"
 #endif
 \f
-#ifdef VMS
-/* The extra parameters substantially improve the I/O performance.  */
-
-static FILE *
-vms_fopen (fname, type)
-     char *fname;
-     char *type;
-{
-  /* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
-     fixed arguments, which matches ANSI's specification but not VAXCRTL's
-     pre-ANSI implementation.  This hack circumvents the mismatch problem.  */
-  FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
-
-  if (*type == 'w')
-    return (*vmslib_fopen) (fname, type, "mbc=32",
-                           "deq=64", "fop=tef", "shr=nil");
-  else
-    return (*vmslib_fopen) (fname, type, "mbc=32");
-}
-
-#define fopen vms_fopen
-#endif /* VMS  */
-
 /* Carry information from ASM_DECLARE_OBJECT_NAME
    to ASM_FINISH_DECLARE_OBJECT.  */
 
@@ -131,11 +107,8 @@ static void init_asm_output PARAMS ((const char *));
 static void finalize PARAMS ((void));
 
 static void set_target_switch PARAMS ((const char *));
-static const char *decl_name PARAMS ((tree, int));
 
-static void float_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
 static void crash_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
-static void set_float_handler PARAMS ((jmp_buf));
 static void compile_file PARAMS ((void));
 static void display_help PARAMS ((void));
 static void display_target_options PARAMS ((void));
@@ -153,6 +126,9 @@ static int print_single_switch PARAMS ((FILE *, int, int, const char *,
 static void print_switch_values PARAMS ((FILE *, int, int, const char *,
                                       const char *, const char *));
 
+/* Nonzero to dump debug info whilst parsing (-dy option).  */
+static int set_yydebug;
+
 /* Length of line when printing switch values.  */
 #define MAX_LINE 75
 
@@ -206,7 +182,7 @@ extern int target_flags;
 
 /* Debug hooks - dependent upon command line options.  */
 
-struct gcc_debug_hooks *debug_hooks = &do_nothing_debug_hooks;
+const struct gcc_debug_hooks *debug_hooks = &do_nothing_debug_hooks;
 
 /* Describes a dump file.  */
 
@@ -376,29 +352,6 @@ tree current_function_decl;
    if none.  */
 tree current_function_func_begin_label;
 
-/* Pointer to function to compute the name to use to print a declaration.
-   DECL is the declaration in question.
-   VERBOSITY determines what information will be printed:
-     0: DECL_NAME, demangled as necessary.
-     1: and scope information.
-     2: and any other information that might be interesting, such as function
-        parameter types in C++.  */
-
-const char *(*decl_printable_name)     PARAMS ((tree, int));
-
-/* Pointer to function to compute rtl for a language-specific tree code.  */
-
-typedef rtx (*lang_expand_expr_t)
-  PARAMS ((union tree_node *, rtx, enum machine_mode,
-         enum expand_modifier modifier));
-
-lang_expand_expr_t lang_expand_expr = 0;
-
-/* Pointer to function to finish handling an incomplete decl at the
-   end of compilation.  */
-
-void (*incomplete_decl_finalize_hook) PARAMS ((tree)) = 0;
-
 /* Nonzero if doing dwarf2 duplicate elimination.  */
 
 int flag_eliminate_dwarf2_dups = 0;
@@ -639,6 +592,14 @@ int flag_syntax_only = 0;
 
 static int flag_gcse;
 
+/* Nonzero means perform loop optimizer.  */
+
+static int flag_loop_optimize;
+
+/* Nonzero means perform crossjumping.  */
+
+static int flag_crossjumping;
+
 /* Nonzero means to use global dataflow analysis to eliminate
    useless null pointer tests.  */
 
@@ -678,7 +639,12 @@ int flag_keep_inline_functions;
 
 /* Nonzero means that functions will not be inlined.  */
 
-int flag_no_inline;
+int flag_no_inline = 2;
+
+/* 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 that we should emit static const variables
    regardless of whether or not optimization is turned on.  */
@@ -930,6 +896,9 @@ debug_args[] =
 #ifdef SDB_DEBUGGING_INFO
   { "coff", SDB_DEBUG, 0, N_("Generate COFF format debug info") },
 #endif
+#ifdef VMS_DEBUGGING_INFO
+  { "vms", VMS_DEBUG, 0, N_("Generate VMS format debug info") },
+#endif
   { 0, 0, 0, 0 }
 };
 
@@ -1043,6 +1012,10 @@ static const lang_independent_options f_options[] =
    N_("Perform enhanced load motion during global subexpression elimination") },
   {"gcse-sm", &flag_gcse_sm, 1,
    N_("Perform store motion after global subexpression elimination") },
+  {"loop-optimize", &flag_loop_optimize, 1,
+   N_("Perform the loop optimizations") },
+  {"crossjumping", &flag_crossjumping, 1,
+   N_("Perform cross-jumping optimization") },
   {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
    N_("Run CSE pass after loop optimizations") },
   {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
@@ -1231,7 +1204,6 @@ documented_lang_options[] =
   { "-Wbad-function-cast",
     N_("Warn about casting functions to incompatible types") },
   { "-Wno-bad-function-cast", "" },
-  { "-Wno-missing-noreturn", "" },
   { "-Wmissing-format-attribute",
     N_("Warn about functions which might be candidates for format attributes") },
   { "-Wno-missing-format-attribute", "" },
@@ -1250,12 +1222,15 @@ documented_lang_options[] =
   { "-Wconversion", 
     N_("Warn about possibly confusing type conversions") },
   { "-Wno-conversion", "" },
+  { "-Wdiv-by-zero", "" },
+  { "-Wno-div-by-zero", 
+    N_("Do not warn about compile-time integer division by zero") },
+  { "-Wfloat-equal", 
+    N_("Warn about testing equality of floating point numbers") },
+  { "-Wno-float-equal", "" },
   { "-Wformat", 
     N_("Warn about printf/scanf/strftime/strfmon format anomalies") },
   { "-Wno-format", "" },
-  { "-Wformat-y2k", "" },
-  { "-Wno-format-y2k",
-    N_("Don't warn about strftime formats yielding 2 digit years") },
   { "-Wformat-extra-args", "" },
   { "-Wno-format-extra-args",
     N_("Don't warn about too many arguments to format functions") },
@@ -1265,6 +1240,9 @@ documented_lang_options[] =
   { "-Wformat-security",
     N_("Warn about possible security problems with format functions") },
   { "-Wno-format-security", "" },
+  { "-Wformat-y2k", "" },
+  { "-Wno-format-y2k",
+    N_("Don't warn about strftime formats yielding 2 digit years") },
   { "-Wimplicit-function-declaration",
     N_("Warn about implicit function declarations") },
   { "-Wno-implicit-function-declaration", "" },
@@ -1301,24 +1279,21 @@ documented_lang_options[] =
   { "-Wparentheses", 
     N_("Warn about possible missing parentheses") },
   { "-Wno-parentheses", "" },
-  { "-Wsequence-point",
-    N_("Warn about possible violations of sequence point rules") },
-  { "-Wno-sequence-point", "" },
   { "-Wpointer-arith", 
     N_("Warn about function pointer arithmetic") },
   { "-Wno-pointer-arith", "" },
   { "-Wredundant-decls",
     N_("Warn about multiple declarations of the same object") },
   { "-Wno-redundant-decls", "" },
+  { "-Wreturn-type",
+    N_("Warn whenever a function's return-type defaults to int") },
+  { "-Wno-return-type", "" },
+  { "-Wsequence-point",
+    N_("Warn about possible violations of sequence point rules") },
+  { "-Wno-sequence-point", "" },
   { "-Wsign-compare", 
     N_("Warn about signed/unsigned comparisons") },
   { "-Wno-sign-compare", "" },
-  { "-Wfloat-equal", 
-    N_("Warn about testing equality of floating point numbers") },
-  { "-Wno-float-equal", "" },
-  { "-Wunknown-pragmas", 
-    N_("Warn about unrecognized pragmas") },
-  { "-Wno-unknown-pragmas", "" },
   { "-Wstrict-prototypes", 
     N_("Warn about non-prototyped function decls") },
   { "-Wno-strict-prototypes", "" },
@@ -1330,6 +1305,9 @@ documented_lang_options[] =
   { "-Wno-trigraphs", "" },
   { "-Wundef", "" },
   { "-Wno-undef", "" },
+  { "-Wunknown-pragmas", 
+    N_("Warn about unrecognized pragmas") },
+  { "-Wno-unknown-pragmas", "" },
   { "-Wwrite-strings", 
     N_("Mark strings as 'const char *'") },
   { "-Wno-write-strings", "" },
@@ -1404,10 +1382,20 @@ int warn_uninitialized;
 
 int warn_shadow;
 
-/* Warn if a switch on an enum fails to have a case for every enum value.  */
+/* Warn if a switch on an enum, that does not have a default case,
+   fails to have a case for every enum value.  */
 
 int warn_switch;
 
+/* Warn if a switch does not have a default case.  */
+
+int warn_switch_default;
+
+/* Warn if a switch on an enum fails to have a case for every enum
+   value (regardless of the presence or otherwise of a default case).  */
+
+int warn_switch_enum;
+
 /* Nonzero means warn about function definitions that default the return type
    or that use a null return and have a return-type other than void.  */
 
@@ -1477,7 +1465,11 @@ static const lang_independent_options W_options[] =
   {"shadow", &warn_shadow, 1,
    N_("Warn when one local variable shadows another") },
   {"switch", &warn_switch, 1,
-   N_("Warn about enumerated switches missing a specific case") },
+   N_("Warn about enumerated switches, with no default, missing a case") },
+  {"switch-default", &warn_switch_default, 1,
+   N_("Warn about enumerated switches missing a default case") },
+  {"switch-enum", &warn_switch_enum, 1,
+   N_("Warn about all enumerated switches missing a specific case") },
   {"aggregate-return", &warn_aggregate_return, 1,
    N_("Warn about returning structures, unions or arrays") },
   {"cast-align", &warn_cast_align, 1,
@@ -1574,19 +1566,7 @@ read_integral_parameter (p, pname, defval)
 
   return atoi (p);
 }
-
 \f
-/* This is the default decl_printable_name function.  */
-
-static const char *
-decl_name (decl, verbosity)
-     tree decl;
-     int verbosity ATTRIBUTE_UNUSED;
-{
-  return IDENTIFIER_POINTER (DECL_NAME (decl));
-}
-\f
-
 /* This calls abort and is used to avoid problems when abort if a macro.
    It is used when we need to pass the address of abort.  */
 
@@ -1640,73 +1620,6 @@ floor_log2_wide (x)
   return log;
 }
 
-static int float_handler_set;
-int float_handled;
-jmp_buf float_handler;
-
-/* Signals actually come here.  */
-
-static void
-float_signal (signo)
-     /* If this is missing, some compilers complain.  */
-     int signo ATTRIBUTE_UNUSED;
-{
-  if (float_handled == 0)
-    crash_signal (signo);
-  float_handled = 0;
-
-  /* On System-V derived systems, we must reinstall the signal handler.
-     This is harmless on BSD-derived systems.  */
-  signal (SIGFPE, float_signal);
-  longjmp (float_handler, 1);
-}
-
-/* Specify where to longjmp to when a floating arithmetic error happens.
-   If HANDLER is 0, it means don't handle the errors any more.  */
-
-static void
-set_float_handler (handler)
-     jmp_buf handler;
-{
-  float_handled = (handler != 0);
-  if (handler)
-    memcpy (float_handler, handler, sizeof (float_handler));
-
-  if (float_handled && ! float_handler_set)
-    {
-      signal (SIGFPE, float_signal);
-      float_handler_set = 1;
-    }
-}
-
-/* This is a wrapper function for code which might elicit an
-   arithmetic exception.  That code should be passed in as a function
-   pointer FN, and one argument DATA.  DATA is usually a struct which
-   contains the real input and output for function FN.  This function
-   returns 0 (failure) if longjmp was called (i.e. an exception
-   occurred.)  It returns 1 (success) otherwise.  */
-
-int
-do_float_handler (fn, data)
-     void (*fn) PARAMS ((PTR));
-     PTR data;
-{
-  jmp_buf buf;
-
-  if (setjmp (buf))
-    {
-      /* We got here via longjmp () caused by an exception in function
-         fn ().  */
-      set_float_handler (NULL);
-      return 0;
-    }
-
-  set_float_handler (buf);
-  (*fn)(data);
-  set_float_handler (NULL);
-  return 1;
-}
-
 /* Handler for fatal signals, such as SIGSEGV.  These are transformed
    into ICE messages, which is much more user friendly.  */
 
@@ -1844,7 +1757,7 @@ open_dump_file (index, decl)
 
   if (decl)
     fprintf (rtl_dump_file, "\n;; Function %s\n\n",
-            decl_printable_name (decl, 2));
+            (*lang_hooks.decl_printable_name) (decl, 2));
 
   timevar_pop (TV_DUMP);
   return 1;
@@ -1907,9 +1820,8 @@ wrapup_global_declarations (vec, len)
       /* We're not deferring this any longer.  */
       DECL_DEFER_OUTPUT (decl) = 0;
 
-      if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0
-         && incomplete_decl_finalize_hook != 0)
-       (*incomplete_decl_finalize_hook) (decl);
+      if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0)
+       (*lang_hooks.finish_incomplete_decl) (decl);
     }
 
   /* Now emit any global variables or functions that we have been
@@ -1950,16 +1862,24 @@ wrapup_global_declarations (vec, len)
             to force a constant to be written if and only if it is
             defined in a main file, as opposed to an include file.  */
 
-         if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
-             && (((! TREE_READONLY (decl) || TREE_PUBLIC (decl))
-                  && !DECL_COMDAT (decl))
-                 || (!optimize
-                     && flag_keep_static_consts
-                     && !DECL_ARTIFICIAL (decl))
-                 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
+         if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
            {
-             reconsider = 1;
-             rest_of_decl_compilation (decl, NULL, 1, 1);
+             bool needed = 1;
+
+             if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
+               /* needed */;
+             else if (DECL_COMDAT (decl))
+               needed = 0;
+             else if (TREE_READONLY (decl) && !TREE_PUBLIC (decl)
+                      && (optimize || !flag_keep_static_consts
+                          || DECL_ARTIFICIAL (decl)))
+               needed = 0;
+
+             if (needed)
+               {
+                 reconsider = 1;
+                 rest_of_decl_compilation (decl, NULL, 1, 1);
+               }
            }
 
          if (TREE_CODE (decl) == FUNCTION_DECL
@@ -2028,22 +1948,19 @@ check_global_declarations (vec, len)
          assemble_external (decl);
        }
 
-      /* Warn about static fns or vars defined but not used,
-        but not about inline functions or static consts
-        since defining those in header files is normal practice.  */
-      if (((warn_unused_function
-           && TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
-          || (warn_unused_variable
-              && TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
-         && ! DECL_IN_SYSTEM_HEADER (decl)
+      /* Warn about static fns or vars defined but not used.  */
+      if (((warn_unused_function && TREE_CODE (decl) == FUNCTION_DECL)
+          || (warn_unused_variable && TREE_CODE (decl) == VAR_DECL))
+         && ! TREE_USED (decl)
+         /* The TREE_USED bit for file-scope decls is kept in the identifier,
+            to handle multiple external decls in different scopes.  */
+         && ! TREE_USED (DECL_NAME (decl))
          && ! DECL_EXTERNAL (decl)
          && ! TREE_PUBLIC (decl)
-         && ! TREE_USED (decl)
-         && (TREE_CODE (decl) == FUNCTION_DECL || ! DECL_REGISTER (decl))
-         /* The TREE_USED bit for file-scope decls
-            is kept in the identifier, to handle multiple
-            external decls in different scopes.  */
-         && ! TREE_USED (DECL_NAME (decl)))
+         /* Global register variables must be declared to reserve them.  */
+         && ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
+         /* Otherwise, ask the language.  */
+         && (*lang_hooks.decls.warn_unused_global) (decl))
        warning_with_decl (decl, "`%s' defined but not used");
 
       timevar_push (TV_SYMOUT);
@@ -2113,9 +2030,9 @@ compile_file ()
 
   timevar_push (TV_PARSE);
 
-  /* Call the parser, which parses the entire file
-     (calling rest_of_compilation for each function).  */
-  yyparse ();
+  /* Call the parser, which parses the entire file (calling
+     rest_of_compilation for each function).  */
+  (*lang_hooks.parse_file) (set_yydebug);
 
   /* In case there were missing block closers,
      get us back to the global binding level.  */
@@ -2123,13 +2040,12 @@ compile_file ()
 
   /* Compilation is now finished except for writing
      what's left of the symbol table output.  */
-
   timevar_pop (TV_PARSE);
 
   if (flag_syntax_only)
     return;
 
-  globals = getdecls ();
+  globals = (*lang_hooks.decls.getdecls) ();
 
   /* Really define vars that have had only a tentative definition.
      Really output inline functions that must actually be callable
@@ -2266,10 +2182,7 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
     {
       timevar_push (TV_VARCONST);
 
-      /* If asmspec non-zero, we may be creating a global register variable.
-        If asmspec zero, we may be making sure that ENCODE_SECTION_INFO is
-        up-to-date.  */
-      if (TREE_CODE (decl) != TYPE_DECL && TREE_CODE (decl) != LABEL_DECL)
+      if (asmspec)
         make_decl_rtl (decl, asmspec);
 
       /* Don't output anything when a tentative file-scope definition
@@ -2349,7 +2262,7 @@ rest_of_type_compilation (type, toplev)
   timevar_pop (TV_SYMOUT);
 }
 
-/* This is called from finish_function (within yyparse)
+/* This is called from finish_function (within langhooks.parse_file)
    after each top-level definition is parsed.
    It is supposed to compile that function or variable
    and output the assembler code for it.
@@ -2464,6 +2377,7 @@ rest_of_compilation (decl)
       if (inlinable
          || (DECL_INLINE (decl)
              && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
+                  && ! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
                   && ! flag_keep_inline_functions)
                  || DECL_EXTERNAL (decl))))
        DECL_DEFER_OUTPUT (decl) = 1;
@@ -2556,10 +2470,12 @@ rest_of_compilation (decl)
      carry magic hard reg data throughout the function.  */
   rtx_equal_function_value_matters = 0;
   purge_hard_subreg_sets (get_insns ());
-  emit_initial_value_sets ();
 
-  /* Don't return yet if -Wreturn-type; we need to do cleanup_cfg.  */
-  if ((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
+  /* Early return if there were errors.  We can run afoul of our
+     consistency checks, and there's not really much point in fixing them.
+     Don't return yet if -Wreturn-type; we need to do cleanup_cfg.  */
+  if (((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
+      || errorcount || sorrycount)
     goto exit_rest_of_compilation;
 
   /* We may have potential sibling or tail recursion sites.  Select one
@@ -2588,6 +2504,10 @@ rest_of_compilation (decl)
       timevar_pop (TV_JUMP);
     }
 
+  /* Delay emitting hard_reg_initial_value sets until after EH landing pad
+     generation, which might create new sets.  */
+  emit_initial_value_sets ();
+
 #ifdef FINALIZE_PIC
   /* If we are doing position-independent code generation, now
      is the time to output special prologues and epilogues.
@@ -2627,7 +2547,8 @@ rest_of_compilation (decl)
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
   if (rtl_dump_file)
     dump_flow_info (rtl_dump_file);
-  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP);
+  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 ();
@@ -2720,8 +2641,7 @@ rest_of_compilation (decl)
       find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
       if (rtl_dump_file)
        dump_flow_info (rtl_dump_file);
-      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP
-                  | (flag_thread_jumps ? CLEANUP_THREADING : 0));
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
 
       /* Try to identify useless null pointer tests and delete them.  */
       if (flag_delete_null_pointer_checks)
@@ -2767,25 +2687,19 @@ rest_of_compilation (decl)
        rebuild_jump_labels (insns);
       purge_all_dead_edges (0);
 
+      delete_trivially_dead_insns (insns, max_reg_num ());
+
       /* If we are not running more CSE passes, then we are no longer
         expecting CSE to be run.  But always rerun it in a cheap mode.  */
       cse_not_expected = !flag_rerun_cse_after_loop && !flag_gcse;
 
       if (tem || optimize > 1)
        cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
-
-      /* Run this after jump optmizations remove all the unreachable code
-        so that unreachable code will not keep values live.  */
-      delete_trivially_dead_insns (insns, max_reg_num (), 1);
-
       /* Try to identify useless null pointer tests and delete them.  */
       if (flag_delete_null_pointer_checks || flag_thread_jumps)
        {
          timevar_push (TV_JUMP);
 
-         cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP
-                      | (flag_thread_jumps ? CLEANUP_THREADING : 0));
-
          if (flag_delete_null_pointer_checks)
            delete_null_pointer_checks (insns);
          /* CFG is no longer maintained up-to-date.  */
@@ -2825,6 +2739,7 @@ rest_of_compilation (decl)
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
       tem = gcse_main (insns, rtl_dump_file);
       rebuild_jump_labels (insns);
+      delete_trivially_dead_insns (insns, max_reg_num ());
 
       save_csb = flag_cse_skip_blocks;
       save_cfj = flag_cse_follow_jumps;
@@ -2838,6 +2753,7 @@ rest_of_compilation (decl)
          reg_scan (insns, max_reg_num (), 1);
          tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
          purge_all_dead_edges (0);
+         delete_trivially_dead_insns (insns, max_reg_num ());
          timevar_pop (TV_CSE);
          cse_not_expected = !flag_rerun_cse_after_loop;
        }
@@ -2849,7 +2765,6 @@ rest_of_compilation (decl)
          tem = tem2 = 0;
          timevar_push (TV_JUMP);
          rebuild_jump_labels (insns);
-         delete_trivially_dead_insns (insns, max_reg_num (), 1);
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
          timevar_pop (TV_JUMP);
 
@@ -2859,6 +2774,7 @@ rest_of_compilation (decl)
              reg_scan (insns, max_reg_num (), 1);
              tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
              purge_all_dead_edges (0);
+             delete_trivially_dead_insns (insns, max_reg_num ());
              timevar_pop (TV_CSE);
            }
        }
@@ -2876,10 +2792,11 @@ rest_of_compilation (decl)
 
   /* Move constant computations out of loops.  */
 
-  if (optimize > 0)
+  if (optimize > 0 && flag_loop_optimize)
     {
       timevar_push (TV_LOOP);
       delete_dead_jumptables ();
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
       open_dump_file (DFI_loop, decl);
       /* CFG is no longer maintained up-to-date.  */
       free_bb_for_insn ();
@@ -2889,14 +2806,13 @@ rest_of_compilation (decl)
          cleanup_barriers ();
 
          /* We only want to perform unrolling once.  */
-
-         loop_optimize (insns, rtl_dump_file, 0);
+         loop_optimize (insns, rtl_dump_file, LOOP_FIRST_PASS);
 
          /* The first call to loop_optimize makes some instructions
             trivially dead.  We delete those instructions now in the
             hope that doing so will make the heuristics in loop work
             better and possibly speed up compilation.  */
-         delete_trivially_dead_insns (insns, max_reg_num (), 0);
+         delete_trivially_dead_insns (insns, max_reg_num ());
 
          /* The regscan pass is currently necessary as the alias
                  analysis code depends on this information.  */
@@ -2908,7 +2824,7 @@ rest_of_compilation (decl)
                     | (flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0));
 
       /* Loop can create trivially dead instructions.  */
-      delete_trivially_dead_insns (insns, max_reg_num (), 0);
+      delete_trivially_dead_insns (insns, max_reg_num ());
       close_dump_file (DFI_loop, print_rtl, insns);
       timevar_pop (TV_LOOP);
 
@@ -2934,7 +2850,8 @@ rest_of_compilation (decl)
 
      life_analyzis rarely eliminates modification of external memory.
    */
-  mark_constant_function ();
+  if (optimize)
+    mark_constant_function ();
 
   close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
 
@@ -2988,6 +2905,7 @@ rest_of_compilation (decl)
          reg_scan (insns, max_reg_num (), 0);
          tem = cse_main (insns, max_reg_num (), 1, rtl_dump_file);
          purge_all_dead_edges (0);
+         delete_trivially_dead_insns (insns, max_reg_num ());
 
          if (tem)
            {
@@ -3006,7 +2924,7 @@ rest_of_compilation (decl)
 
   cse_not_expected = 1;
 
-  close_dump_file (DFI_life, print_rtl_with_bb, insns);
+  open_dump_file (DFI_life, decl);
   regclass_init ();
 
   check_function_return_warnings ();
@@ -3016,7 +2934,8 @@ rest_of_compilation (decl)
 #endif
   life_analysis (insns, rtl_dump_file, PROP_FINAL);
   if (optimize)
-    cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
+    cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_UPDATE_LIFE
+                | (flag_thread_jumps ? CLEANUP_THREADING : 0));
   timevar_pop (TV_FLOW);
 
   no_new_pseudos = 1;
@@ -3057,10 +2976,6 @@ rest_of_compilation (decl)
       rebuild_jump_labels_after_combine
        = combine_instructions (insns, max_reg_num ());
 
-      /* Always purge dead edges, as we may eliminate an insn throwing
-         exception.  */
-      rebuild_jump_labels_after_combine |= purge_all_dead_edges (true);
-
       /* Combining insns may have turned an indirect jump into a
         direct jump.  Rebuid the JUMP_LABEL fields of jumping
         instructions.  */
@@ -3245,6 +3160,7 @@ rest_of_compilation (decl)
       timevar_push (TV_JUMP);
 
       rebuild_jump_labels (insns);
+      purge_all_dead_edges (0);
 
       timevar_pop (TV_JUMP);
     }
@@ -3273,8 +3189,9 @@ rest_of_compilation (decl)
 
   if (optimize)
     {
-      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP);
       life_analysis (insns, rtl_dump_file, PROP_FINAL);
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
+                  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
 
       /* This is kind of a heuristic.  We need to run combine_stack_adjustments
          even for machines with possibly nonzero RETURN_POPS_ARGS
@@ -3376,10 +3293,11 @@ rest_of_compilation (decl)
       timevar_push (TV_REORDER_BLOCKS);
       open_dump_file (DFI_bbro, decl);
 
-      /* Last attempt to optimize CFG, as life analyzis possibly removed
-        some instructions.  */
+      /* Last attempt to optimize CFG, as scheduling, peepholing
+        and insn splitting possibly introduced more crossjumping
+        oppurtuntities.  */
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
-                  | CLEANUP_CROSSJUMP);
+                  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
       if (flag_reorder_blocks)
        {
          reorder_basic_blocks ();
@@ -3806,7 +3724,7 @@ decode_d_option (arg)
        rtl_dump_and_exit = 1;
        break;
       case 'y':
-       (*lang_hooks.set_yydebug) (1);
+       set_yydebug = 1;
        break;
       case 'D':        /* These are handled by the preprocessor.  */
       case 'I':
@@ -4058,7 +3976,7 @@ ignoring option `%s' due to invalid debug level specification",
 
              if (da_len > 1 && strncmp (arg, "gdb", da_len) == 0)
                {
-#if defined (DWARF2_DEBUGGING_INFO) && !defined (LINKER_DOES_NOT_WORK_WITH_DWARF2)
+#ifdef DWARF2_DEBUGGING_INFO
                  type = DWARF2_DEBUG;
 #else
 #ifdef DBX_DEBUGGING_INFO
@@ -4574,10 +4492,6 @@ general_init (argv0)
 
   gcc_init_libintl ();
 
-  /* Install handler for SIGFPE, which may be received while we do
-     compile-time floating point arithmetic.  */
-  signal (SIGFPE, float_signal);
-
   /* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages.  */
 #ifdef SIGSEGV
   signal (SIGSEGV, crash_signal);
@@ -4594,6 +4508,9 @@ general_init (argv0)
 #if defined SIGIOT && (!defined SIGABRT || SIGABRT != SIGIOT)
   signal (SIGIOT, crash_signal);
 #endif
+#ifdef SIGFPE
+  signal (SIGFPE, crash_signal);
+#endif
 
   /* Initialize the diagnostics reporting machinery, so option parsing
      can give warnings and errors.  */
@@ -4674,6 +4591,8 @@ parse_options_and_default_flags (argc, argv)
 #endif
       flag_guess_branch_prob = 1;
       flag_cprop_registers = 1;
+      flag_loop_optimize = 1;
+      flag_crossjumping = 1;
     }
 
   if (optimize >= 2)
@@ -4801,6 +4720,11 @@ parse_options_and_default_flags (argc, argv)
        }
     }
 
+  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
@@ -4820,6 +4744,9 @@ parse_options_and_default_flags (argc, argv)
        warning ("-Wuninitialized is not supported without -O");
     }
 
+  if (flag_really_no_inline == 2)
+    flag_really_no_inline = flag_no_inline;
+
   /* All command line options have been parsed; allow the front end to
      perform consistency checks, etc.  */
   (*lang_hooks.post_options) ();
@@ -5013,14 +4940,6 @@ process_options ()
 static void
 lang_independent_init ()
 {
-  decl_printable_name = decl_name;
-  lang_expand_expr = (lang_expand_expr_t) do_abort;
-
-  /* Set the language-dependent identifier size.  */
-  tree_code_length[(int) IDENTIFIER_NODE]
-    = ((lang_hooks.identifier_size - sizeof (struct tree_common)
-       + sizeof (tree) - 1) / sizeof (tree));
-
   /* Initialize the garbage-collector, and string pools.  */
   init_ggc ();
   ggc_add_rtx_root (&stack_limit_rtx, 1);