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] Obvious fix to fix_irreducible_loops


Hello,

there is an obvious mistake in fix_irreducible_loops.  Given that the
code could never work the way it is now written, it seems that it was
never executed (not really surprising, as it is only useful in the
unlikely case when an irreducible region is removed due to loop
unswitching).

Commited as obvious.

Zdenek

Changelog:
	* cfgloopmanip.c (fix_irreducible_loops): Initialize e
	correctly.

Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 cfgloopmanip.c
*** cfgloopmanip.c	5 Oct 2003 19:50:54 -0000	1.16
--- cfgloopmanip.c	7 Oct 2003 22:05:51 -0000
*************** fix_irreducible_loops (basic_block from)
*** 310,327 ****
  	}
  
        for (i = 0; i < n_edges; i++)
! 	if (e->flags & EDGE_IRREDUCIBLE_LOOP)
! 	  {
! 	    if (!flow_bb_inside_loop_p (from->loop_father, e->dest))
! 	      continue;
  
! 	    e->flags &= ~EDGE_IRREDUCIBLE_LOOP;
! 	    if (TEST_BIT (on_stack, e->dest->index))
! 	      continue;
  
! 	    SET_BIT (on_stack, e->dest->index);
! 	    stack[stack_top++] = e->dest;
! 	  }
        free (edges);
      }
  
--- 310,331 ----
  	}
  
        for (i = 0; i < n_edges; i++)
! 	{
! 	  e = edges[i];
  
! 	  if (e->flags & EDGE_IRREDUCIBLE_LOOP)
! 	    {
! 	      if (!flow_bb_inside_loop_p (from->loop_father, e->dest))
! 		continue;
  
! 	      e->flags &= ~EDGE_IRREDUCIBLE_LOOP;
! 	      if (TEST_BIT (on_stack, e->dest->index))
! 		continue;
! 
! 	      SET_BIT (on_stack, e->dest->index);
! 	      stack[stack_top++] = e->dest;
! 	    }
! 	}
        free (edges);
      }
  


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