OSDN Git Service

* ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog.5, ChangeLog,
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index ca77de7..5825c55 100644 (file)
@@ -68,6 +68,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "integrate.h"
 #include "debug.h"
 #include "target.h"
+#include "langhooks.h"
 
 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
 #include "dwarf2out.h"
@@ -85,6 +86,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "xcoffout.h"          /* Needed for external data
                                   declarations for e.g. AIX 4.x.  */
 #endif
+
+#ifdef HALF_PIC_DEBUG
+#include "halfpic.h"
+#endif
 \f
 #ifdef VMS
 /* The extra parameters substantially improve the I/O performance.  */
@@ -919,10 +924,13 @@ int flag_renumber_insns = 1;
 
 int align_loops;
 int align_loops_log;
+int align_loops_max_skip;
 int align_jumps;
 int align_jumps_log;
+int align_jumps_max_skip;
 int align_labels;
 int align_labels_log;
+int align_labels_max_skip;
 int align_functions;
 int align_functions_log;
 
@@ -1115,7 +1123,7 @@ lang_independent_options f_options[] =
   {"rename-registers", &flag_rename_registers, 1,
    N_("Do the register renaming optimization pass") },
   {"common", &flag_no_common, 0,
-   N_("Do not put unitialised globals in the common section") },
+   N_("Do not put uninitialized globals in the common section") },
   {"inhibit-size-directive", &flag_inhibit_size_directive, 1,
    N_("Do not generate .size directives") },
   {"function-sections", &flag_function_sections, 1,
@@ -1165,7 +1173,7 @@ lang_independent_options f_options[] =
   {"ssa", &flag_ssa, 1,
    N_("Enable SSA optimizations") },
   {"ssa-ccp", &flag_ssa_ccp, 1,
-   N_("Enable SSA conditonal constant propagation") },
+   N_("Enable SSA conditional constant propagation") },
   {"ssa-dce", &flag_ssa_dce, 1,
    N_("Enable aggressive SSA dead code elimination") },
   {"leading-underscore", &flag_leading_underscore, 1,
@@ -1535,7 +1543,7 @@ lang_independent_options W_options[] =
   {"unreachable-code", &warn_notreached, 1,
    N_("Warn about code that will never be executed") },
   {"uninitialized", &warn_uninitialized, 1,
-   N_("Warn about unitialized automatic variables") },
+   N_("Warn about uninitialized automatic variables") },
   {"inline", &warn_inline, 1,
    N_("Warn when an inlined function cannot be inlined") },
   {"packed", &warn_packed, 1,
@@ -1715,7 +1723,7 @@ set_float_handler (handler)
    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
-   occured.)  It returns 1 (success) otherwise.  */
+   occurred.)  It returns 1 (success) otherwise.  */
 
 int
 do_float_handler (fn, data)
@@ -2334,8 +2342,7 @@ compile_file (name)
 
   /* In case there were missing block closers,
      get us back to the global binding level.  */
-  while (! global_bindings_p ())
-    poplevel (0, 0, 0);
+  (*lang_hooks.clear_binding_stack) ();
 
   /* Compilation is now finished except for writing
      what's left of the symbol table output.  */
@@ -2479,6 +2486,7 @@ compile_file (name)
     {
       ggc_print_statistics ();
       stringpool_statistics ();
+      dump_tree_statistics ();
     }
 
   /* Free up memory for the benefit of leak detectors.  */
@@ -2752,7 +2760,7 @@ rest_of_compilation (decl)
              cleanup_cfg (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP);
              optimize = saved_optimize;
 
-             /* CFG is no longer maitained up-to-date.  */
+             /* CFG is no longer maintained up-to-date.  */
              free_bb_for_insn ();
            }
 
@@ -2863,7 +2871,7 @@ rest_of_compilation (decl)
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
   cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP);
 
-  /* CFG is no longer maitained up-to-date.  */
+  /* CFG is no longer maintained up-to-date.  */
   free_bb_for_insn ();
   copy_loop_headers (insns);
   purge_line_number_notes (insns);
@@ -2942,7 +2950,7 @@ rest_of_compilation (decl)
       timevar_pop (TV_FROM_SSA);
 
       ggc_collect ();
-      /* CFG is no longer maitained up-to-date.  */
+      /* CFG is no longer maintained up-to-date.  */
       free_bb_for_insn ();
     }
 
@@ -2961,7 +2969,7 @@ rest_of_compilation (decl)
       if_convert (0);
       timevar_pop (TV_IFCVT);
 
-      /* CFG is no longer maitained up-to-date.  */
+      /* CFG is no longer maintained up-to-date.  */
       free_bb_for_insn ();
       /* Try to identify useless null pointer tests and delete them.  */
       if (flag_delete_null_pointer_checks)
@@ -3012,7 +3020,7 @@ rest_of_compilation (decl)
          find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
          timevar_pop (TV_JUMP);
-         /* CFG is no longer maitained up-to-date.  */
+         /* CFG is no longer maintained up-to-date.  */
          free_bb_for_insn ();
        }
 
@@ -3029,7 +3037,7 @@ rest_of_compilation (decl)
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
 
          delete_null_pointer_checks (insns);
-         /* CFG is no longer maitained up-to-date.  */
+         /* CFG is no longer maintained up-to-date.  */
          free_bb_for_insn ();
          timevar_pop (TV_JUMP);
        }
@@ -3069,7 +3077,7 @@ rest_of_compilation (decl)
       save_cfj = flag_cse_follow_jumps;
       flag_cse_skip_blocks = flag_cse_follow_jumps = 0;
 
-      /* CFG is no longer maitained up-to-date.  */
+      /* CFG is no longer maintained up-to-date.  */
       free_bb_for_insn ();
       /* If -fexpensive-optimizations, re-run CSE to clean up things done
         by gcse.  */
@@ -3092,7 +3100,7 @@ rest_of_compilation (decl)
          delete_trivially_dead_insns (insns, max_reg_num (), 0);
          find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
-         /* CFG is no longer maitained up-to-date.  */
+         /* CFG is no longer maintained up-to-date.  */
          free_bb_for_insn ();
          timevar_pop (TV_JUMP);
 
@@ -3181,7 +3189,7 @@ rest_of_compilation (decl)
 
          timevar_pop (TV_JUMP);
 
-         /* CFG is no longer maitained up-to-date.  */
+         /* CFG is no longer maintained up-to-date.  */
          free_bb_for_insn ();
          reg_scan (insns, max_reg_num (), 0);
          tem = cse_main (insns, max_reg_num (), 1, rtl_dump_file);
@@ -3192,7 +3200,7 @@ rest_of_compilation (decl)
              rebuild_jump_labels (insns);
              find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
              cleanup_cfg (CLEANUP_EXPENSIVE);
-             /* CFG is no longer maitained up-to-date.  */
+             /* CFG is no longer maintained up-to-date.  */
              free_bb_for_insn ();
              timevar_pop (TV_JUMP);
            }
@@ -3298,7 +3306,7 @@ rest_of_compilation (decl)
 
       /* Always purge dead edges, as we may eliminate an insn throwing
          exception.  */
-      rebuild_jump_labels_after_combine |= purge_all_dead_edges ();
+      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
@@ -3309,20 +3317,7 @@ rest_of_compilation (decl)
          rebuild_jump_labels (insns);
          timevar_pop (TV_JUMP);
 
-         timevar_push (TV_FLOW);
-         cleanup_cfg (CLEANUP_EXPENSIVE);
-
-         /* Blimey.  We've got to have the CFG up to date for the call to
-            if_convert below.  However, the random deletion of blocks
-            without updating life info can wind up with Wierd Stuff in
-            global_live_at_end.  We then run sched1, which updates things
-            properly, discovers the wierdness and aborts.  */
-         allocate_bb_life_data ();
-         update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
-                           PROP_DEATH_NOTES | PROP_KILL_DEAD_CODE
-                           | PROP_SCAN_DEAD_CODE);
-
-         timevar_pop (TV_FLOW);
+         cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
        }
 
       close_dump_file (DFI_combine, print_rtl_with_bb, insns);
@@ -3645,7 +3640,7 @@ rest_of_compilation (decl)
     }
   compute_alignments ();
 
-  /* CFG is no longer maitained up-to-date.  */
+  /* CFG is no longer maintained up-to-date.  */
   free_bb_for_insn ();
 
   /* If a machine dependent reorganization is needed, call it.  */
@@ -4021,7 +4016,7 @@ display_target_options ()
     }
 }
 \f
-/* Parse a -d... comand line switch.  */
+/* Parse a -d... command line switch.  */
 
 static void
 decode_d_option (arg)
@@ -4053,7 +4048,7 @@ decode_d_option (arg)
        rtl_dump_and_exit = 1;
        break;
       case 'y':
-       set_yydebug (1);
+       (*lang_hooks.set_yydebug) (1);
        break;
       case 'D':        /* These are handled by the preprocessor.  */
       case 'I':
@@ -4074,7 +4069,7 @@ decode_d_option (arg)
       }
 }
 
-/* Parse a -f... comand line switch.  ARG is the value after the -f.
+/* Parse a -f... command line switch.  ARG is the value after the -f.
    It is safe to access 'ARG - 2' to generate the full switch name.
    Return the number of strings consumed.  */
 
@@ -4178,7 +4173,7 @@ decode_f_option (arg)
   return 1;
 }
 
-/* Parse a -W... comand line switch.  ARG is the value after the -W.
+/* Parse a -W... command line switch.  ARG is the value after the -W.
    It is safe to access 'ARG - 2' to generate the full switch name.
    Return the number of strings consumed.  */
 
@@ -4229,7 +4224,7 @@ decode_W_option (arg)
   return 1;
 }
 
-/* Parse a -g... comand line switch.  ARG is the value after the -g.
+/* 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.  */
 
@@ -4655,6 +4650,10 @@ toplev_main (argc, argv)
   flag_short_enums = DEFAULT_SHORT_ENUMS;
 #endif
 
+  tree_code_length[(int) IDENTIFIER_NODE]
+    = ((lang_hooks.identifier_size - sizeof (struct tree_common))
+       / sizeof (tree));
+
   /* Initialize the garbage-collector.  */
   init_ggc ();
   init_stringpool ();
@@ -4668,7 +4667,7 @@ toplev_main (argc, argv)
   /* Register the language-independent parameters.  */
   add_params (lang_independent_params, LAST_PARAM);
 
-  /* Perform language-specific options intialization.  */
+  /* Perform language-specific options initialization.  */
   (*lang_hooks.init_options) ();
 
   /* Scan to see what optimization level has been specified.  That will
@@ -4881,11 +4880,17 @@ toplev_main (argc, argv)
   /* Set up the align_*_log variables, defaulting them to 1 if they
      were still unset.  */
   if (align_loops <= 0) align_loops = 1;
+  if (align_loops_max_skip > align_loops || !align_loops)
+    align_loops_max_skip = align_loops - 1;
   align_loops_log = floor_log2 (align_loops * 2 - 1);
   if (align_jumps <= 0) align_jumps = 1;
+  if (align_jumps_max_skip > align_jumps || !align_jumps)
+    align_jumps_max_skip = align_jumps - 1;
   align_jumps_log = floor_log2 (align_jumps * 2 - 1);
   if (align_labels <= 0) align_labels = 1;
   align_labels_log = floor_log2 (align_labels * 2 - 1);
+  if (align_labels_max_skip > align_labels || !align_labels)
+    align_labels_max_skip = align_labels - 1;
   if (align_functions <= 0) align_functions = 1;
   align_functions_log = floor_log2 (align_functions * 2 - 1);
 
@@ -5023,7 +5028,7 @@ print_version (file, indent)
           "%s%s%s version %s (%s) compiled by CC.\n"
 #endif
           , indent, *indent != 0 ? " " : "",
-          language_string, version_string, TARGET_NAME,
+          lang_hooks.name, version_string, TARGET_NAME,
           indent, __VERSION__);
 }