RFR: Fix || and && chaining warnings in memnode.cpp
Aleksey Shipilev
shade at redhat.com
Mon Mar 12 16:34:41 UTC 2018
This fixes another compiler warning about || and && chaining in memnode.cpp. The first block is our
own addition. The second block is the change we did against upstream, and we just revert it to
upstream form:
https://builds.shipilev.net/patch-openjdk-shenandoah-jdk/2018-03-11-v32-vs-02404e27d356/src/hotspot/share/opto/memnode.cpp.sdiff.html
diff -r 1c743cca5468 src/hotspot/share/opto/memnode.cpp
--- a/src/hotspot/share/opto/memnode.cpp Mon Mar 12 17:25:35 2018 +0100
+++ b/src/hotspot/share/opto/memnode.cpp Mon Mar 12 17:30:45 2018 +0100
@@ -1133,8 +1133,8 @@
(value->in(0)->in(1) != NULL &&
value->in(0)->in(1)->is_IfProj() &&
(igvn->_worklist.member(value->in(0)->in(1)) ||
- value->in(0)->in(1)->in(0) != NULL &&
- igvn->_worklist.member(value->in(0)->in(1)->in(0))))) {
+ (value->in(0)->in(1)->in(0) != NULL &&
+ igvn->_worklist.member(value->in(0)->in(1)->in(0)))))) {
igvn->_worklist.push(this);
return this;
}
@@ -1266,10 +1266,10 @@
Node* elements[4];
int shift = exact_log2(type2aelembytes(T_OBJECT));
int count = address->unpack_offsets(elements, ARRAY_SIZE(elements));
- if ((count > 0) && elements[0]->is_Con() &&
- ((count == 1) ||
- (count == 2) && elements[1]->Opcode() == Op_LShiftX &&
- elements[1]->in(2) == phase->intcon(shift))) {
+ if (count > 0 && elements[0]->is_Con() &&
+ (count == 1 ||
+ (count == 2 && elements[1]->Opcode() == Op_LShiftX &&
+ elements[1]->in(2) == phase->intcon(shift)))) {
ciObjArray* array = base_type->const_oop()->as_obj_array();
// Fetch the box object cache[0] at the base of the array and get its value
ciInstance* box = array->obj_at(0)->as_instance();
Testing: hotspot_gc_shenandoah
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list