aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-01-14 00:24:33 +0000
committerJeff Law <law@gcc.gnu.org>1998-01-13 17:24:33 -0700
commita8decb2c2b4be39f422c559227cc5bfccc438e60 (patch)
tree9b616f8dd8799a4726c6d3782ca44439c97247e1 /gcc/loop.c
parent0e2b736c8077b268b5beb83fb6ab3745405a5407 (diff)
downloadgcc-a8decb2c2b4be39f422c559227cc5bfccc438e60.zip
gcc-a8decb2c2b4be39f422c559227cc5bfccc438e60.tar.gz
gcc-a8decb2c2b4be39f422c559227cc5bfccc438e60.tar.bz2
loop.c (check_dbra_loop): Make sure initial value is a CONST_INT before trying to normalize it.
* loop.c (check_dbra_loop): Make sure initial value is a CONST_INT before trying to normalize it. From-SVN: r17352
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index a26c04a..a3f276e 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -6214,10 +6214,11 @@ check_dbra_loop (loop_end, insn_count, loop_start)
comparison_val = INTVAL (XEXP (comparison, 1));
initial_value = bl->initial_value;
- /* Normalize the initial value if it has no other use
- except as a counter. This will allow a few more loops
- to be reversed. */
- if (no_use_except_counting)
+ /* Normalize the initial value if it is an integer and
+ has no other use except as a counter. This will allow
+ a few more loops to be reversed. */
+ if (no_use_except_counting
+ && GET_CODE (initial_value) == CONST_INT)
{
comparison_val = comparison_val - INTVAL (bl->initial_value);
initial_value = const0_rtx;