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]

[patch] For PR 17806


Hello,

we do not update IRREDUCIBLE_LOOP flags in loop_commit_inserts,
which causes this ICE.  The easiest way how to fix this seems
to be to move the updating of this flag to split_edge.

Bootstrapped & regtested on i686.

Zdenek

	PR tree-optimization/17806
	* cfghooks.c (split_edge): Update IRREDUCIBLE_LOOP flags.
	* cfgloopmanip.c (loop_split_edge_with): Updating of IRREDUCIBLE_LOOP
	flags moved to split_edge.

Index: cfghooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfghooks.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 cfghooks.c
*** cfghooks.c	29 Sep 2004 02:15:00 -0000	1.15
--- cfghooks.c	3 Oct 2004 22:06:11 -0000
*************** split_edge (edge e)
*** 389,394 ****
--- 389,395 ----
    gcov_type count = e->count;
    int freq = EDGE_FREQUENCY (e);
    edge f;
+   bool irr = (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
  
    if (!cfg_hooks->split_edge)
      internal_error ("%s does not support split_edge.", cfg_hooks->name);
*************** split_edge (edge e)
*** 399,404 ****
--- 400,412 ----
    EDGE_SUCC (ret, 0)->probability = REG_BR_PROB_BASE;
    EDGE_SUCC (ret, 0)->count = count;
  
+   if (irr)
+     {
+       ret->flags |= BB_IRREDUCIBLE_LOOP;
+       EDGE_PRED (ret, 0)->flags |= EDGE_IRREDUCIBLE_LOOP;
+       EDGE_SUCC (ret, 0)->flags |= EDGE_IRREDUCIBLE_LOOP;
+     }
+ 
    if (dom_computed[CDI_DOMINATORS])
      set_immediate_dominator (CDI_DOMINATORS, ret, EDGE_PRED (ret, 0)->src);
  
Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.33
diff -c -3 -p -r1.33 cfgloopmanip.c
*** cfgloopmanip.c	28 Sep 2004 07:59:43 -0000	1.33
--- cfgloopmanip.c	3 Oct 2004 22:06:11 -0000
*************** loop_split_edge_with (edge e, rtx insns)
*** 1241,1247 ****
  {
    basic_block src, dest, new_bb;
    struct loop *loop_c;
-   edge new_e;
  
    src = e->src;
    dest = e->dest;
--- 1241,1246 ----
*************** loop_split_edge_with (edge e, rtx insns)
*** 1252,1265 ****
  
    new_bb = split_edge (e);
    add_bb_to_loop (new_bb, loop_c);
!   new_bb->flags = insns ? BB_SUPERBLOCK : 0;
! 
!   new_e = EDGE_SUCC (new_bb, 0);
!   if (e->flags & EDGE_IRREDUCIBLE_LOOP)
!     {
!       new_bb->flags |= BB_IRREDUCIBLE_LOOP;
!       new_e->flags |= EDGE_IRREDUCIBLE_LOOP;
!     }
  
    if (insns)
      emit_insn_after (insns, BB_END (new_bb));
--- 1251,1257 ----
  
    new_bb = split_edge (e);
    add_bb_to_loop (new_bb, loop_c);
!   new_bb->flags |= (insns ? BB_SUPERBLOCK : 0);
  
    if (insns)
      emit_insn_after (insns, BB_END (new_bb));


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