OSDN Git Service

* loop.c (emit_prefetch_instructions): Properly place the address computation.
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index b0c1d40..6eecb96 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Top level of GNU C compiler
    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
    1999, 2000, 2001, 2002 Free Software Foundation, Inc.
@@ -223,6 +224,7 @@ enum dump_file_index
   DFI_loop,
   DFI_cfg,
   DFI_bp,
+  DFI_tracer,
   DFI_cse2,
   DFI_life,
   DFI_combine,
@@ -270,6 +272,7 @@ static struct dump_file_info dump_file[DFI_MAX] =
   { "loop",    'L', 1, 0, 0 },
   { "cfg",     'f', 1, 0, 0 },
   { "bp",      'b', 1, 0, 0 },
+  { "tracer",  'T', 1, 0, 0 },
   { "cse2",    't', 1, 0, 0 },
   { "life",    'f', 1, 0, 0 }, /* Yes, duplicate enable switch.  */
   { "combine", 'c', 1, 0, 0 },
@@ -865,6 +868,10 @@ int flag_merge_constants = 1;
    one, unconditionally renumber instruction UIDs.  */
 int flag_renumber_insns = 1;
 
+/* Nonzero if we perform superblock formation.  */
+
+int flag_tracer = 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
@@ -976,6 +983,8 @@ static const lang_independent_options f_options[] =
    N_("When possible do not generate stack frames") },
   {"optimize-sibling-calls", &flag_optimize_sibling_calls, 1,
    N_("Optimize sibling and tail recursive calls") },
+  {"tracer", &flag_tracer, 1,
+   N_("Perform superblock formation via tail duplication") },
   {"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,
@@ -1672,7 +1681,7 @@ strip_off_ending (name, len)
      int len;
 {
   int i;
-  for (i = 2; i < 6 && len > i;  i++)
+  for (i = 2; i < 6 && len > i; i++)
     {
       if (name[len - i] == '.')
        {
@@ -1714,17 +1723,16 @@ output_quoted_string (asm_file, string)
    usable as an identifier in a target's assembly file.  */
 void
 output_clean_symbol_name (file, name)
-    FILE *file;
-    const char *name;
+     FILE *file;
+     const char *name;
 {
   /* Make a copy of NAME.  */
-  char *id = (char *)xmalloc (strlen (name) + 1);
-  strcpy (id, name);
+  char *id = xstrdup (name);
 
   /* Make it look like a valid identifier for an assembler.  */
   clean_symbol_name (id);
-  
-  fputs (file, name);
+
+  fputs (id, file);
   free (id);
 }
 
@@ -2562,9 +2570,10 @@ rest_of_compilation (decl)
            && NOTE_LINE_NUMBER (insn) == NOTE_INSN_PREDICTION)
          delete_insn (insn);
     }
-   close_dump_file (DFI_sibling, print_rtl, get_insns ());
-   timevar_pop (TV_JUMP);
+  close_dump_file (DFI_sibling, print_rtl, get_insns ());
+  timevar_pop (TV_JUMP);
 
+  scope_to_insns_initialize ();
   /* Complete generation of exception handling code.  */
   find_exception_handler_labels ();
   if (doing_eh (0))
@@ -2958,6 +2967,19 @@ rest_of_compilation (decl)
       close_dump_file (DFI_bp, print_rtl_with_bb, insns);
       timevar_pop (TV_BRANCH_PROB);
     }
+  if (flag_tracer)
+    {
+      timevar_push (TV_TRACER);
+      open_dump_file (DFI_tracer, decl);
+      if (rtl_dump_file)
+       dump_flow_info (rtl_dump_file);
+      cleanup_cfg (CLEANUP_EXPENSIVE);
+      tracer ();
+      cleanup_cfg (CLEANUP_EXPENSIVE);
+      close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
+      timevar_pop (TV_TRACER);
+      reg_scan (get_insns (), max_reg_num (), 0);
+    }
 
   if (optimize > 0)
     {
@@ -4893,16 +4915,6 @@ process_options ()
     warning ("this target machine does not have delayed branches");
 #endif
 
-  /* Some operating systems do not allow profiling without a frame
-     pointer.  */
-  if (!TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
-      && profile_flag
-      && flag_omit_frame_pointer)
-    {
-      error ("profiling does not work without a frame pointer");
-      flag_omit_frame_pointer = 0;
-    }
-
   user_label_prefix = USER_LABEL_PREFIX;
   if (flag_leading_underscore != -1)
     {