aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-01-03 10:05:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-01-03 10:05:43 +0100
commit3461a16e0bab8b8b00ff2567700439c7d4e5dda4 (patch)
treebf717bd5e0292f0afa63db0a241a01e20f3d4a9e /gcc/loop-iv.c
parent8b5546d6740ad9c56eaed8285ff501da3453e924 (diff)
downloadgcc-3461a16e0bab8b8b00ff2567700439c7d4e5dda4.zip
gcc-3461a16e0bab8b8b00ff2567700439c7d4e5dda4.tar.gz
gcc-3461a16e0bab8b8b00ff2567700439c7d4e5dda4.tar.bz2
re PR rtl-optimization/55838 (ICE in extract_insn (unrecognizable insn) with -O -funroll-loops)
PR rtl-optimization/55838 * loop-iv.c (iv_number_of_iterations): Call lowpart_subreg on iv0.step, iv1.step and step. * gcc.dg/pr55838.c: New test. From-SVN: r194837
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 50b7536..d089fbf 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1,5 +1,5 @@
/* Rtl-level induction variable analysis.
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2406,6 +2406,9 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
iv1.step = const0_rtx;
}
+ iv0.step = lowpart_subreg (mode, iv0.step, comp_mode);
+ iv1.step = lowpart_subreg (mode, iv1.step, comp_mode);
+
/* This is either infinite loop or the one that ends immediately, depending
on initial values. Unswitching should remove this kind of conditions. */
if (iv0.step == const0_rtx && iv1.step == const0_rtx)
@@ -2516,6 +2519,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
step = simplify_gen_unary (NEG, comp_mode, iv1.step, comp_mode);
else
step = iv0.step;
+ step = lowpart_subreg (mode, step, comp_mode);
delta = simplify_gen_binary (MINUS, comp_mode, iv1.base, iv0.base);
delta = lowpart_subreg (mode, delta, comp_mode);
delta = simplify_gen_binary (UMOD, mode, delta, step);