RFR (XS) 8252291: C2: Assignment in conditional in loopUnswitch.cpp

Aleksey Shipilev shade at redhat.com
Tue Aug 25 07:34:40 UTC 2020


Cleanup:
   https://bugs.openjdk.java.net/browse/JDK-8252291

Static code analysis complains there is the assignment in the conditional here. I believe the 
assignment should be explicit here. Code was introduced with JDK-8136725.

diff -r 31de2a59348a src/hotspot/share/opto/loopUnswitch.cpp
--- a/src/hotspot/share/opto/loopUnswitch.cpp   Tue Aug 25 09:27:04 2020 +0200
+++ b/src/hotspot/share/opto/loopUnswitch.cpp   Tue Aug 25 09:29:23 2020 +0200
@@ -442,7 +442,8 @@

    if (iff->in(1)->Opcode() != Op_ConI) {
      return false;
    }

-  return _has_reserved = true;
+  _has_reserved = true;
+  return true;
  }

Testing: local builds

-- 
Thanks,
-Aleksey



More information about the hotspot-compiler-dev mailing list