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]

New patch for PR tree-optimization/32087, ICE on -fprefetch-loop-arrays


I submitted an earlier patch
(http://gcc.gnu.org/ml/gcc-patches/2007-06/msg00357.html) for this PR
that checked for a zero inside scale_bbs_frequencies_int.  This patch
checks for zero before calling scale_bbs_frequencies_int (in
tree_transform_and_unroll_loop).

Functions like remove_empty_loop and scale_dominated_blocks_in_loop
already have checks in them to make sure scale_bbs_frequencies_int is
not called in cases where a division by zero might happen so it seems
reasonable to check it here too.

Tested on IA64 HP-UX and Linux.

OK for checkin?


2007-06-06  Steve Ellcey  <sje@cup.hp.com>

	PR tree-optimization/32087
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop):
	Do not call scale_bbs_frequencies_int with prob of zero.


Index: tree-ssa-loop-manip.c
===================================================================
--- tree-ssa-loop-manip.c	(revision 126897)
+++ tree-ssa-loop-manip.c	(working copy)
@@ -1036,8 +1036,9 @@ tree_transform_and_unroll_loop (struct l
   new_nonexit->count = exit_bb->count - new_exit->count;
   if (new_nonexit->count < 0)
     new_nonexit->count = 0;
-  scale_bbs_frequencies_int (&loop->latch, 1, new_nonexit->probability,
-			     prob);
+  if (prob > 0)
+    scale_bbs_frequencies_int (&loop->latch, 1, new_nonexit->probability,
+			       prob);
 
   /* Finally create the new counter for number of iterations and add the new
      exit instruction.  */


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