summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-02 09:37:20 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-02 09:37:20 +0000
commite00fda43f2a95b08339238bf7eadb7174780d691 (patch)
tree0ba4373ac2ecf552eaffb171563fd51e63e6d384 /gcc/fold-const.c
parent492de4b7d9b991829897f8ebe38bd3da17357f67 (diff)
downloadgcc-e00fda43f2a95b08339238bf7eadb7174780d691.tar.gz
* fold-const.c (fold_range_test): Do not try to fold the range
test if the rhs or lhs has side effects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 4 insertions, 0 deletions
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)