Skip to content

Commit 9313c4c

Browse files
GeorgNeisCommit Bot
authored andcommitted
[compiler] Fix a bug in VisitSpeculativeIntegerAdditiveOp
Bug: chromium:1199345 Change-Id: I33bf71b33f43919fec4684054b5bf0a0787930ca Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831478 Reviewed-by: Nico Hartmann <[email protected]> Commit-Queue: Georg Neis <[email protected]> Cr-Commit-Position: refs/heads/master@{#74008}
1 parent 5259600 commit 9313c4c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/compiler/simplified-lowering.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,10 +1478,15 @@ class RepresentationSelector {
14781478
Type right_feedback_type = TypeOf(node->InputAt(1));
14791479

14801480
// Using Signed32 as restriction type amounts to promising there won't be
1481-
// signed overflow. This is incompatible with relying on a Word32
1482-
// truncation in order to skip the overflow check.
1481+
// signed overflow. This is incompatible with relying on a Word32 truncation
1482+
// in order to skip the overflow check. Similarly, we must not drop -0 from
1483+
// the result type unless we deopt for -0 inputs.
14831484
Type const restriction =
1484-
truncation.IsUsedAsWord32() ? Type::Any() : Type::Signed32();
1485+
truncation.IsUsedAsWord32()
1486+
? Type::Any()
1487+
: (truncation.identify_zeros() == kIdentifyZeros)
1488+
? Type::Signed32OrMinusZero()
1489+
: Type::Signed32();
14851490

14861491
// Handle the case when no int32 checks on inputs are necessary (but
14871492
// an overflow check is needed on the output). Note that we do not

0 commit comments

Comments
 (0)