8322758: Eliminate -Wparentheses warnings in C2 code

Reviewed-by: aph, kvn
This commit is contained in:
Kim Barrett 2024-01-02 22:32:58 +00:00
parent e9e694f4ef
commit 122bc7770e
9 changed files with 27 additions and 25 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -977,8 +977,8 @@ Node* CallNode::Ideal(PhaseGVN* phase, bool can_reshape) {
// Validate attached generator
CallGenerator* cg = generator();
if (cg != nullptr) {
assert(is_CallStaticJava() && cg->is_mh_late_inline() ||
is_CallDynamicJava() && cg->is_virtual_late_inline(), "mismatch");
assert((is_CallStaticJava() && cg->is_mh_late_inline()) ||
(is_CallDynamicJava() && cg->is_virtual_late_inline()), "mismatch");
}
#endif // ASSERT
return SafePointNode::Ideal(phase, can_reshape);
@ -1638,8 +1638,8 @@ Node *AllocateArrayNode::make_ideal_length(const TypeOopPtr* oop_type, PhaseValu
// - the narrow_length is 0
// - the narrow_length is not wider than length
assert(narrow_length_type == TypeInt::ZERO ||
length_type->is_con() && narrow_length_type->is_con() &&
(narrow_length_type->_hi <= length_type->_lo) ||
(length_type->is_con() && narrow_length_type->is_con() &&
(narrow_length_type->_hi <= length_type->_lo)) ||
(narrow_length_type->_hi <= length_type->_hi &&
narrow_length_type->_lo >= length_type->_lo),
"narrow type must be narrower than length type");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -163,8 +163,8 @@ public:
bool is_scalable() {
#ifdef ASSERT
if (_is_scalable) {
assert(_is_vector && (_num_regs == RegMask::SlotsPerVecA) ||
_is_predicate && (_num_regs == RegMask::SlotsPerRegVectMask), "unexpected scalable reg");
assert((_is_vector && (_num_regs == RegMask::SlotsPerVecA)) ||
(_is_predicate && (_num_regs == RegMask::SlotsPerRegVectMask)), "unexpected scalable reg");
}
#endif
return Matcher::implements_scalable_vector && _is_scalable;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -3140,8 +3140,8 @@ void Compile::final_graph_reshaping_impl(Node *n, Final_Reshape_Counts& frc, Uni
int alias_idx = get_alias_index(n->as_Mem()->adr_type());
assert( n->in(0) != nullptr || alias_idx != Compile::AliasIdxRaw ||
// oop will be recorded in oop map if load crosses safepoint
n->is_Load() && (n->as_Load()->bottom_type()->isa_oopptr() ||
LoadNode::is_immutable_value(n->in(MemNode::Address))),
(n->is_Load() && (n->as_Load()->bottom_type()->isa_oopptr() ||
LoadNode::is_immutable_value(n->in(MemNode::Address)))),
"raw memory operations should have control edge");
}
if (n->is_MemBar()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1121,7 +1121,7 @@ void ConnectionGraph::add_final_edges(Node *n) {
return;
}
assert(n->is_Store() || n->is_LoadStore() ||
(n_ptn != nullptr) && (n_ptn->ideal_node() != nullptr),
((n_ptn != nullptr) && (n_ptn->ideal_node() != nullptr)),
"node should be registered already");
int opcode = n->Opcode();
bool gc_handled = BarrierSet::barrier_set()->barrier_set_c2()->escape_add_final_edges(this, _igvn, n, opcode);
@ -3856,7 +3856,7 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist,
record_for_optimizer(n);
} else {
assert(tn_type == TypePtr::NULL_PTR ||
tn_t != nullptr && !tinst->maybe_java_subtype_of(tn_t),
(tn_t != nullptr && !tinst->maybe_java_subtype_of(tn_t)),
"unexpected type");
continue; // Skip dead path with different type
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -150,8 +150,9 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
bool is_decoden = ((intptr_t)val) & 1;
val = (Node*)(((intptr_t)val) & ~1);
assert(!is_decoden || (val->in(0) == nullptr) && val->is_Mach() &&
(val->as_Mach()->ideal_Opcode() == Op_DecodeN), "sanity");
assert(!is_decoden ||
((val->in(0) == nullptr) && val->is_Mach() &&
(val->as_Mach()->ideal_Opcode() == Op_DecodeN)), "sanity");
// Search the successor block for a load or store who's base value is also
// the tested value. There may be several.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -797,7 +797,8 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree* loop, Node* ctrl, int scal
overflow = false;
Node* max_idx_expr = nullptr;
const TypeInt* idx_type = TypeInt::INT;
if ((stride > 0) == (scale > 0) == upper) {
// same signs and upper, or different signs and not upper.
if (((stride > 0) == (scale > 0)) == upper) {
guarantee(limit != nullptr, "sanity");
if (TraceLoopPredicate) {
if (limit->is_Con()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -4955,7 +4955,7 @@ static void verify_memory_slice(const MergeMemNode* m, int alias_idx, Node* n) {
//-----------------------------memory_at---------------------------------------
Node* MergeMemNode::memory_at(uint alias_idx) const {
assert(alias_idx >= Compile::AliasIdxRaw ||
alias_idx == Compile::AliasIdxBot && !Compile::current()->do_aliasing(),
(alias_idx == Compile::AliasIdxBot && !Compile::current()->do_aliasing()),
"must avoid base_memory and AliasIdxTop");
// Otherwise, it is a narrow slice.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -788,7 +788,7 @@ public:
StoreNode(c, mem, adr, at, val, oop_store, MemNode::release),
_oop_alias_idx(oop_alias_idx) {
assert(_oop_alias_idx >= Compile::AliasIdxRaw ||
_oop_alias_idx == Compile::AliasIdxBot && !Compile::current()->do_aliasing(),
(_oop_alias_idx == Compile::AliasIdxBot && !Compile::current()->do_aliasing()),
"bad oop alias idx");
}
virtual int Opcode() const;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -448,7 +448,7 @@ protected:
}
// Light version of set_req() to init inputs after node creation.
void init_req( uint i, Node *n ) {
assert( i == 0 && this == n ||
assert( (i == 0 && this == n) ||
is_not_dead(n), "can not use dead node");
assert( i < _cnt, "oob");
assert( !VerifyHashTableKeys || _hash_lock == 0,