JDK-8225783 : Incorrect use of binary operators on booleans in type.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13,14
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-06-14
  • Updated: 2020-06-16
  • Resolved: 2019-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.8-oracleFixed 13.0.4Fixed 14 b02Fixed
Related Reports
Relates :  
Description
http://hg.openjdk.java.net/jdk/jdk/file/865775b86780/src/hotspot/share/opto/type.cpp#l2112
http://hg.openjdk.java.net/jdk/jdk/file/865775b86780/src/hotspot/share/opto/type.cpp#l4392
http://hg.openjdk.java.net/jdk/jdk/file/865775b86780/src/hotspot/share/opto/type.cpp#l4364
http://hg.openjdk.java.net/jdk/jdk/file/865775b86780/src/hotspot/share/opto/type.cpp#l3882

See:
https://stackoverflow.com/questions/24542/using-bitwise-operators-for-booleans-in-c
Comments
Fix request (13u): I would like to backport this fix to 13u for parity with 11u. The original change applies cleanly.
08-06-2020

jdk11 backport request I would like to have the patch in OpenJDK11 as well, because the issue is present there too. The patch applies cleanly.
12-05-2020

I would not like to have the issue in OpenJDK11 but rather the fix :)
11-05-2020

Okay. I was concern with "potentially unexpected behavior". But you are right, in these cases it is not an issue.
17-06-2019

Do you think it's worth a backport? The use of binary operators is harmless in this case because even if the compiler reorders the statement, it's still valid (it doesn't matter which operand we evaluate first).
17-06-2019

[~thartmann] Please consider backporting this fix to jdk13 and 11u.
14-06-2019

http://cr.openjdk.java.net/~thartmann/8225783/webrev.00/
14-06-2019

ILW = Use of binary operator instead of logical leading to potentially unexpected behavior, not an issue in these cases, no workaround = LLH = P5
14-06-2019