ast: swap range regardless of range_left >= 0
authorEddie Hung <eddie@fpgeh.com>
Mon, 4 May 2020 19:18:20 +0000 (12:18 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 4 May 2020 19:18:20 +0000 (12:18 -0700)
frontends/ast/simplify.cc

index 837c14ad773e3e700e5bc10e4523c2c5505f109e..cdb7e91e076757ca33fd931ac43ae99624a8cdc5 100644 (file)
@@ -1079,7 +1079,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
                }
                if (old_range_valid != range_valid)
                        did_something = true;
-               if (range_valid && range_left >= 0 && range_right > range_left) {
+               if (range_valid && range_right > range_left) {
                        int tmp = range_right;
                        range_right = range_left;
                        range_left = tmp;