diff options
author | Jeffrey A Law <law@cygnus.com> | 1999-09-07 08:25:56 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-09-07 02:25:56 -0600 |
commit | 907a26b876f7e9f03de5fa0770b07d5c13ca9f99 (patch) | |
tree | 7678f38ab483457cfec789a20018d55562e27338 | |
parent | 7559393d82bd445bc7d58c9c8e248687e0730194 (diff) | |
download | gcc-907a26b876f7e9f03de5fa0770b07d5c13ca9f99.zip gcc-907a26b876f7e9f03de5fa0770b07d5c13ca9f99.tar.gz gcc-907a26b876f7e9f03de5fa0770b07d5c13ca9f99.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fold-const.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d86ae81..18820b1 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 <scott@igc.apc.org> * 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 dc9ca93..c9778ba 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) |