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]

Re: make CFG survive post-reload splitting: SH breakage


> > Does this patch looks like sensible solution?
> 
> This can't possibly work, since split_all_insns is called from toplev.c after
> dbr_schedule.
Uh, I see.
Originally I had patch to kill that split_all_insns, but I've never sent
it for review, as I came to conclusion that machine depednent reorg may
want to introduce splittable insns.

Obvious solution is to add _noflow to that call too.

I apologize for this faiulure. I should've checked and not think in the
i386 world only.

I've tested on random example that sh seems to be happy again. OK if it
works for you too?

Mon Jul 23 23:18:40 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* recog.c (split_all_insns_noflow): New.
	* rtl.h (split_all_insns_noflow): Declare.
	* ia64.c (ia64_reorg): Use split_all_insns_noflow.
	* m68hc11.c (m68hc11_reorg): Likewise.
	* sh.c (machine_dependent_reorg): Likewise.
	* toplev.c (rest_of_compilation): Likewise for last split_all_insns
	call.

Index: recog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/recog.c,v
retrieving revision 1.115
diff -c -3 -p -r1.115 recog.c
*** recog.c	2001/07/23 14:08:11	1.115
--- recog.c	2001/07/23 21:16:07
*************** split_all_insns (upd_life)
*** 2777,2782 ****
--- 2777,2798 ----
  
    sbitmap_free (blocks);
  }
+ 
+ /* Same as split_all_insns, but do not expect CFG to be available. 
+    Used by machine depedent reorg passes.  */
+ 
+ void
+ split_all_insns_noflow ()
+ {
+   rtx next, insn;
+ 
+   for (insn = get_insns (); insn; insn = next)
+     {
+       next = NEXT_INSN (insn);
+       split_insn (insn);
+     }
+   return;
+ }
  
  #ifdef HAVE_peephole2
  struct peep2_insn_data
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.c,v
retrieving revision 1.104
diff -c -3 -p -r1.104 ia64.c
*** ia64.c	2001/07/19 23:26:51	1.104
--- ia64.c	2001/07/23 21:16:09
*************** ia64_reorg (insns)
*** 6457,6463 ****
  {
    /* If optimizing, we'll have split before scheduling.  */
    if (optimize == 0)
!     split_all_insns (0);
  
    /* Make sure the CFG and global_live_at_start are correct
       for emit_predicate_relation_info.  */
--- 6457,6463 ----
  {
    /* If optimizing, we'll have split before scheduling.  */
    if (optimize == 0)
!     split_all_insns_noflow ();
  
    /* Make sure the CFG and global_live_at_start are correct
       for emit_predicate_relation_info.  */
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.18
diff -c -3 -p -r1.18 m68hc11.c
*** m68hc11.c	2001/07/20 19:34:56	1.18
--- m68hc11.c	2001/07/23 21:16:11
*************** m68hc11_reorg (first)
*** 4803,4809 ****
  
    /* Force a split of all splitable insn.  This is necessary for the
       Z register replacement mechanism because we end up with basic insns.  */
!   split_all_insns (0);
    split_done = 1;
  
    z_replacement_completed = 1;
--- 4803,4809 ----
  
    /* Force a split of all splitable insn.  This is necessary for the
       Z register replacement mechanism because we end up with basic insns.  */
!   split_all_insns_noflow ();
    split_done = 1;
  
    z_replacement_completed = 1;
*************** m68hc11_reorg (first)
*** 4850,4856 ****
       split after Z register replacement.  This gives more opportunities
       for peephole (in particular for consecutives xgdx/xgdy).  */
    if (optimize > 0)
!     split_all_insns (0);
  
    /* Once insns are split after the z_replacement_completed == 2,
       we must not re-run the life_analysis.  The xgdx/xgdy patterns
--- 4850,4856 ----
       split after Z register replacement.  This gives more opportunities
       for peephole (in particular for consecutives xgdx/xgdy).  */
    if (optimize > 0)
!     split_all_insns_noflow ();
  
    /* Once insns are split after the z_replacement_completed == 2,
       we must not re-run the life_analysis.  The xgdx/xgdy patterns
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.c,v
retrieving revision 1.109
diff -c -3 -p -r1.109 sh.c
*** sh.c	2001/07/11 20:35:55	1.109
--- sh.c	2001/07/23 21:16:12
*************** machine_dependent_reorg (first)
*** 3023,3029 ****
       optimizing, they'll have already been split.  Otherwise, make
       sure we don't split them too late.  */
    if (! optimize)
!     split_all_insns (0);
  
    /* If relaxing, generate pseudo-ops to associate function calls with
       the symbols they call.  It does no harm to not generate these
--- 3023,3029 ----
       optimizing, they'll have already been split.  Otherwise, make
       sure we don't split them too late.  */
    if (! optimize)
!     split_all_insns_noflow ();
  
    /* If relaxing, generate pseudo-ops to associate function calls with
       the symbols they call.  It does no harm to not generate these
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.277
diff -c -3 -p -r1.277 rtl.h
*** rtl.h	2001/07/23 14:08:11	1.277
--- rtl.h	2001/07/23 21:18:14
*************** extern enum reg_class reg_alternate_clas
*** 1462,1467 ****
--- 1462,1468 ----
  extern rtx get_first_nonparm_insn	PARAMS ((void));
  
  extern void split_all_insns		PARAMS ((int));
+ extern void split_all_insns_noflow	PARAMS ((void));
  
  #define MAX_SAVED_CONST_INT 64
  extern rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.496
diff -c -3 -p -r1.496 toplev.c
*** toplev.c	2001/07/23 14:08:12	1.496
--- toplev.c	2001/07/24 08:49:47
*************** rest_of_compilation (decl)
*** 3624,3630 ****
  
  #if defined (HAVE_ATTR_length) && !defined (STACK_REGS)
    timevar_push (TV_SHORTEN_BRANCH);
!   split_all_insns (0);
    timevar_pop (TV_SHORTEN_BRANCH);
  #endif
  
--- 3628,3634 ----
  
  #if defined (HAVE_ATTR_length) && !defined (STACK_REGS)
    timevar_push (TV_SHORTEN_BRANCH);
!   split_all_insns_noflow ();
    timevar_pop (TV_SHORTEN_BRANCH);
  #endif
  


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