From: Jeffrey A Law Date: Thu, 2 Sep 1999 09:37:20 +0000 (+0000) Subject: fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8c61259522b6380059d092abfb7ca9c61fc36bf;p=gcc.git fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs has side effects. * fold-const.c (fold_range_test): Do not try to fold the range test if the rhs or lhs has side effects. From-SVN: r29058 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42f596bbd45..a40330ddf56 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -13,6 +13,9 @@ Thu Sep 2 00:43:59 1999 Finn Hakansson 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. + * combine.c (simplify_rtx): Recognize another case of a synthesized sign extension. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ed353f89627..3cde5f539b0 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3560,6 +3560,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)