RFR: 8257182: JCK test failures in integer / long rotation tests

Christian Hagedorn chagedorn at openjdk.java.net
Wed Dec 2 14:10:10 UTC 2020


The `RotateLeftNode::Value()` and `RotateRightNode::Value()` methods use an arithmetic instead of a logical shift due to applying the shift operator `>>` to a signed instead of an unsigned number. When, for example, rotating a negative even integer (least significant bit is 0) to the right, we should always get a positive number (most significant bit becoming 0). However, the arithmetic shift keeps the integer being negative. This lets some JCK rotation tests fail with -Xcomp.

The previously failing JCK tests work again with -Xcomp by applying this fix.

Thanks,
Christian

-------------

Commit messages:
 - 8257182: JCK test failures in integer / long rotation tests

Changes: https://git.openjdk.java.net/jdk/pull/1562/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1562&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257182
  Stats: 94 lines in 2 files changed: 86 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1562.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1562/head:pull/1562

PR: https://git.openjdk.java.net/jdk/pull/1562


More information about the hotspot-compiler-dev mailing list