sh.c (sh_output_mi_thunk): Initialize and clean up the minimal CFG stuff always when...
authorKaz Kojima <kkojima@gcc.gnu.org>
Sun, 3 Jul 2005 05:21:42 +0000 (05:21 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Sun, 3 Jul 2005 05:21:42 +0000 (05:21 +0000)
* config/sh/sh.c (sh_output_mi_thunk): Initialize and clean
up the minimal CFG stuff always when optimize > 0.  Call
split_all_insns_noflow in PIC case if needed.

From-SVN: r101546

gcc/ChangeLog
gcc/config/sh/sh.c

index 3ef3f08..37d4105 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-03  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.c (sh_output_mi_thunk): Initialize and clean
+       up the minimal CFG stuff always when optimize > 0.  Call
+       split_all_insns_noflow in PIC case if needed.
+
 2005-07-02  Gabriel Dos Reis  <gdr@integrable-solutions.net>
             Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
 
index 300c104..6e8e299 100644 (file)
@@ -9619,7 +9619,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
   insn_locators_initialize ();
   insns = get_insns ();
 
-  if (optimize > 0 && flag_schedule_insns_after_reload)
+  if (optimize > 0)
     {
       /* Initialize the bitmap obstacks.  */
       bitmap_obstack_initialize (NULL);
@@ -9627,31 +9627,36 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
       if (! cfun->cfg)
        init_flow ();
       rtl_register_cfg_hooks ();
+      init_rtl_bb_info (ENTRY_BLOCK_PTR);
+      init_rtl_bb_info (EXIT_BLOCK_PTR);
+      ENTRY_BLOCK_PTR->flags |= BB_RTL;
+      EXIT_BLOCK_PTR->flags |= BB_RTL;
       find_basic_blocks (insns);
-      life_analysis (dump_file, PROP_FINAL);
 
-      split_all_insns (1);
+      if (flag_schedule_insns_after_reload)
+       {
+         life_analysis (dump_file, PROP_FINAL);
+
+         split_all_insns (1);
 
-      schedule_insns (dump_file);
+         schedule_insns (dump_file);
+       }
+      /* We must split jmp insn in PIC case.  */
+      else if (flag_pic)
+       split_all_insns_noflow ();
     }
 
   sh_reorg ();
 
   if (optimize > 0 && flag_delayed_branch)
-    {
-      if (! cfun->cfg)
-       {
-         init_flow ();
-         find_basic_blocks (insns);
-       }
-      dbr_schedule (insns, dump_file);
-    }
+    dbr_schedule (insns, dump_file);
+
   shorten_branches (insns);
   final_start_function (insns, file, 1);
   final (insns, file, 1);
   final_end_function ();
 
-  if (optimize > 0 && flag_schedule_insns_after_reload)
+  if (optimize > 0)
     {
       /* Release all memory allocated by flow.  */
       free_basic_block_vars ();