File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1453,10 +1453,15 @@ class RepresentationSelector {
1453
1453
Type right_feedback_type = TypeOf (node->InputAt (1 ));
1454
1454
1455
1455
// Using Signed32 as restriction type amounts to promising there won't be
1456
- // signed overflow. This is incompatible with relying on a Word32
1457
- // truncation in order to skip the overflow check.
1456
+ // signed overflow. This is incompatible with relying on a Word32 truncation
1457
+ // in order to skip the overflow check. Similarly, we must not drop -0 from
1458
+ // the result type unless we deopt for -0 inputs.
1458
1459
Type const restriction =
1459
- truncation.IsUsedAsWord32 () ? Type::Any () : Type::Signed32 ();
1460
+ truncation.IsUsedAsWord32 ()
1461
+ ? Type::Any ()
1462
+ : (truncation.identify_zeros () == kIdentifyZeros )
1463
+ ? Type::Signed32OrMinusZero ()
1464
+ : Type::Signed32 ();
1460
1465
1461
1466
// Handle the case when no int32 checks on inputs are necessary (but
1462
1467
// an overflow check is needed on the output). Note that we do not
You can’t perform that action at this time.
0 commit comments