From: Jeffrey A Law Date: Tue, 7 Sep 1999 08:25:56 +0000 (+0000) Subject: fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs... X-Git-Tag: releases/gcc-2.95.2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=907a26b876f7e9f03de5fa0770b07d5c13ca9f99;p=thirdparty%2Fgcc.git fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs has side effects. Thu Sep 2 00:06:43 1999 Jeffrey A Law (law@cygnus.com) * fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs has side effects. From-SVN: r29162 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d86ae8162dfb..18820b1896ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ Tue Sep 7 01:27:21 1999 Jeffrey A Law (law@cygnus.com) + Thu Sep 2 00:06:43 1999 Jeffrey A Law (law@cygnus.com) + * fold-const.c (fold_range_test): Do not try to fold the range + test if the rhs or lhs has side effects. + Sun Aug 29 03:27:23 1999 Scott Weikart * fix-header.c (main): Do not pass a null pointer to strcmp. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index dc9ca938b795..c9778ba351df 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3558,6 +3558,10 @@ fold_range_test (exp) tree rhs = make_range (TREE_OPERAND (exp, 1), &in1_p, &low1, &high1); tree tem; + /* Fail if anything is volatile. */ + if (TREE_SIDE_EFFECTS (lhs) || TREE_SIDE_EFFECTS (rhs)) + return 0; + /* If this is an OR operation, invert both sides; we will invert again at the end. */ if (or_op)