]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs...
authorJeffrey A Law <law@cygnus.com>
Tue, 7 Sep 1999 08:25:56 +0000 (08:25 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 7 Sep 1999 08:25:56 +0000 (02:25 -0600)
        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

gcc/ChangeLog
gcc/fold-const.c

index d86ae8162dfbcac5a0357d7941265e8459fd8250..18820b1896ff6e7a1e473b2f69b64851980358ce 100644 (file)
@@ -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 <scott@igc.apc.org>
        * fix-header.c (main): Do not pass a null pointer to strcmp.
 
index dc9ca938b7954aa5ca331cf339d5980323812aa0..c9778ba351df651887592d5982d44ec1e7894994 100644 (file)
@@ -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)