This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] SH: Bootstrap failure


> You are no longer guaranteed to call find_basic_blocks
> before dbr_schedule.  The find_basic_blocks schould move
> above the if (flag_schedule_insns_after_reload)
> condition.

Ugh.  Is the appended patch ok if the usual bootstrap/regression
tests are successful on sh4-unknown-linux-gnu?

Regards,
	kaz
--
--- ORIG/gcc/gcc/config/sh/sh.c	2005-06-29 11:19:08.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.c	2005-07-02 13:56:44.000000000 +0900
@@ -9619,7 +9619,7 @@ sh_output_mi_thunk (FILE *file, tree thu
   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 thu
       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 ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]