aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>2000-01-04 08:36:51 +0000
committerJeff Law <law@gcc.gnu.org>2000-01-04 01:36:51 -0700
commitc565a6b7cb4b31b81476c061eab530bc289cc353 (patch)
tree624826dd12515b4c4ce724fed3f35287e6f9c0ab /gcc/fold-const.c
parent70dec765ec4e331c550a3732f09acd98954c8967 (diff)
downloadgcc-c565a6b7cb4b31b81476c061eab530bc289cc353.zip
gcc-c565a6b7cb4b31b81476c061eab530bc289cc353.tar.gz
gcc-c565a6b7cb4b31b81476c061eab530bc289cc353.tar.bz2
* fold-const.c (make_range): Don't try to reverse an unbounded range.
From-SVN: r31197
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 8f94161..c540b19 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1,5 +1,5 @@
/* Fold a constant sub-tree into a single node for C-compiler
- Copyright (C) 1987, 88, 92-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-98, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -3315,9 +3315,10 @@ make_range (exp, pin_p, plow, phigh)
in_p = n_in_p, low = n_low, high = n_high;
- /* If the high bound is missing, reverse the range so it
- goes from zero to the low bound minus 1. */
- if (high == 0)
+ /* If the high bound is missing, but we
+ have a low bound, reverse the range so
+ it goes from zero to the low bound minus 1. */
+ if (high == 0 && low)
{
in_p = ! in_p;
high = range_binop (MINUS_EXPR, NULL_TREE, low, 0,