From 4aa3463a6b98e41070d03ddbe60e689537b02b59 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Mon, 31 Jul 2017 08:05:26 -0700 Subject: handle squared shifts of an unreachable --- src/passes/OptimizeInstructions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 60222c3cd..6179833b8 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -539,9 +539,9 @@ struct OptimizeInstructions : public WalkerPasstype)) { + if (total == Bits::getEffectiveShifts(total, right->type)) { // no overflow, we can do this - leftRight->value = LiteralUtils::makeLiteralFromInt32(total, left->type); + leftRight->value = LiteralUtils::makeLiteralFromInt32(total, right->type); return left; } // TODO: handle overflows } -- cgit v1.2.3