summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-24 17:45:04 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-24 17:45:04 +0000
commit1fdbc76b33c97f774468ef5f134f026f220b2c1b (patch)
treec4752b2cd4a02d7beebff1142d13df82c0635c8d /gcc/fold-const.c
parentb5083cca4e5c9c2dd8b3afc857fc56dc0f28de11 (diff)
downloadgcc-1fdbc76b33c97f774468ef5f134f026f220b2c1b.tar.gz
Fix crash in fold_range_test
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 9284a1943a9..aaff05f4d75 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3780,6 +3780,7 @@ fold_range_test (exp)
short-circuited branch and the underlying object on both sides
is the same, make a non-short-circuit operation. */
else if (BRANCH_COST >= 2
+ && lhs != 0 && rhs != 0
&& (TREE_CODE (exp) == TRUTH_ANDIF_EXPR
|| TREE_CODE (exp) == TRUTH_ORIF_EXPR)
&& operand_equal_p (lhs, rhs, 0))