aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloopmanip.c
diff options
context:
space:
mode:
authorZdenek Dvorak <ook@ucw.cz>2011-03-05 15:28:14 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-03-05 15:28:14 +0100
commit634ee309bb7a6ece7b02ccb86aec0061d7e5e444 (patch)
tree8380a4d0ef4aacbc3059d789c8ee2360c0c3d0fc /gcc/cfgloopmanip.c
parent6fe471c8ca8eddcfa7ed64b290e24758bbca669e (diff)
downloadgcc-634ee309bb7a6ece7b02ccb86aec0061d7e5e444.zip
gcc-634ee309bb7a6ece7b02ccb86aec0061d7e5e444.tar.gz
gcc-634ee309bb7a6ece7b02ccb86aec0061d7e5e444.tar.bz2
re PR rtl-optimization/47899 (ICE in get_loop_body, at cfgloop.c:831)
PR rtl-optimization/47899 * cfgloopmanip.c (fix_bb_placements): Fix first argument to flow_loop_nested_p when moving the loop upward. * gcc.dg/pr47899.c: New test. From-SVN: r170699
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r--gcc/cfgloopmanip.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index aa9ab66..3802f9c 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -1,5 +1,5 @@
/* Loop manipulation code for GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -174,7 +174,7 @@ fix_bb_placements (basic_block from,
{
sbitmap in_queue;
basic_block *queue, *qtop, *qbeg, *qend;
- struct loop *base_loop;
+ struct loop *base_loop, *target_loop;
edge e;
/* We pass through blocks back-reachable from FROM, testing whether some
@@ -214,12 +214,14 @@ fix_bb_placements (basic_block from,
/* Subloop header, maybe move the loop upward. */
if (!fix_loop_placement (from->loop_father))
continue;
+ target_loop = loop_outer (from->loop_father);
}
else
{
/* Ordinary basic block. */
if (!fix_bb_placement (from))
continue;
+ target_loop = from->loop_father;
}
FOR_EACH_EDGE (e, ei, from->succs)
@@ -248,9 +250,12 @@ fix_bb_placements (basic_block from,
&& (nca == base_loop
|| nca != pred->loop_father))
pred = pred->loop_father->header;
- else if (!flow_loop_nested_p (from->loop_father, pred->loop_father))
+ else if (!flow_loop_nested_p (target_loop, pred->loop_father))
{
- /* No point in processing it. */
+ /* If PRED is already higher in the loop hierarchy than the
+ TARGET_LOOP to that we moved FROM, the change of the position
+ of FROM does not affect the position of PRED, so there is no
+ point in processing it. */
continue;
}