This is the mail archive of the gcc@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: Ordering of splitting passes


> Because we need splitting pass there anyway to assist the other passes.
> I believed that the other passes are not supposed to introduce
> unsplittable instructions...

What I mean is why scattering #ifdef STACK_REGS all over the place? The 
attached patch cures the problem on the 3.3 branch, although I guess I'll 
have to backport Jakub's patch instead (which is pretty ugly IMHO :-)

-- 
Eric Botcazou
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.690.2.22
diff -u -p -r1.690.2.22 toplev.c
--- toplev.c	17 Sep 2003 07:17:09 -0000	1.690.2.22
+++ toplev.c	7 Oct 2003 09:48:33 -0000
@@ -2364,6 +2364,7 @@ rest_of_compilation (decl)
   int failure = 0;
   int rebuild_label_notes_after_reload;
   int register_life_up_to_date;
+  int insns_split_before_shed2 ATTRIBUTE_UNUSED;
 
   timevar_push (TV_REST_OF_COMPILATION);
 
@@ -3361,9 +3362,7 @@ rest_of_compilation (decl)
 #endif
 
   /* If optimizing, then go ahead and split insns now.  */
-#ifndef STACK_REGS
   if (optimize > 0)
-#endif
     split_all_insns (0);
 
   if (optimize)
@@ -3436,6 +3435,8 @@ rest_of_compilation (decl)
       timevar_pop (TV_IFCVT2);
     }
 
+  insns_split_before_shed2 = 0;
+
 #ifdef INSN_SCHEDULING
   if (optimize > 0 && flag_schedule_insns_after_reload)
     {
@@ -3446,6 +3447,7 @@ rest_of_compilation (decl)
 	 and write some more of the results to dump file.  */
 
       split_all_insns (1);
+      insns_split_before_shed2 = 1;
 
       schedule_insns (rtl_dump_file);
 
@@ -3464,6 +3466,11 @@ rest_of_compilation (decl)
 #ifdef STACK_REGS
   timevar_push (TV_REG_STACK);
   open_dump_file (DFI_stack, decl);
+
+  /* We have to split now because we won't split before
+     shorten_branches below.  */
+  if (! insns_split_before_shed2)
+    split_all_insns (optimize > 0);
 
   reg_to_stack (insns, rtl_dump_file);
 

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