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 @@ -1318,10 +1318,15 @@ class RepresentationSelector {
1318
1318
Type right_feedback_type = TypeOf (node->InputAt (1 ));
1319
1319
1320
1320
// Using Signed32 as restriction type amounts to promising there won't be
1321
- // signed overflow. This is incompatible with relying on a Word32
1322
- // truncation in order to skip the overflow check.
1321
+ // signed overflow. This is incompatible with relying on a Word32 truncation
1322
+ // in order to skip the overflow check. Similarly, we must not drop -0 from
1323
+ // the result type unless we deopt for -0 inputs.
1323
1324
Type const restriction =
1324
- truncation.IsUsedAsWord32 () ? Type::Any () : Type::Signed32 ();
1325
+ truncation.IsUsedAsWord32 ()
1326
+ ? Type::Any ()
1327
+ : (truncation.identify_zeros () == kIdentifyZeros )
1328
+ ? Type::Signed32OrMinusZero ()
1329
+ : Type::Signed32 ();
1325
1330
1326
1331
// Handle the case when no int32 checks on inputs are necessary (but
1327
1332
// 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