diff options
author | Jeffrey A Law <law@cygnus.com> | 1999-09-02 09:37:20 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-09-02 03:37:20 -0600 |
commit | a8c61259522b6380059d092abfb7ca9c61fc36bf (patch) | |
tree | 0ba4373ac2ecf552eaffb171563fd51e63e6d384 /gcc/fold-const.c | |
parent | 88bf1faf57dae2fd38f3fb152a8ed5b2aae3a4a0 (diff) | |
download | gcc-a8c61259522b6380059d092abfb7ca9c61fc36bf.zip gcc-a8c61259522b6380059d092abfb7ca9c61fc36bf.tar.gz gcc-a8c61259522b6380059d092abfb7ca9c61fc36bf.tar.bz2 |
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ed353f8..3cde5f5 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) |