RFR: 8322759: Eliminate -Wparentheses warnings in compiler code

Aleksey Shipilev shade at openjdk.org
Wed Jan 3 12:12:48 UTC 2024


On Fri, 29 Dec 2023 03:33:11 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to eliminate some -Wparentheses warnings. This
> involved simply adding a few parentheses to make some implicit operator
> precedence explicit.
> 
> This change addresses non-C2 parts of the compiler component.
> 
> Testing: mach5 tier1
> 
> Also ran mach5 tier1 with these changes in conjunction enabling -Wparentheses
> and other changes needed to make that work.

src/hotspot/share/compiler/compilerDefinitions.inline.hpp line 60:

> 58: 
> 59: inline bool CompilerConfig::is_c1_or_interpreter_only_no_jvmci() {
> 60:   assert((is_jvmci_compiler() && is_jvmci()) || !is_jvmci_compiler(), "JVMCI compiler implies enabled JVMCI");

This looks like simply:


assert(!is_jvmci_compiler() || is_jvmci(), "JVMCI compiler implies enabled JVMCI");

src/hotspot/share/compiler/compilerDefinitions.inline.hpp line 117:

> 115: // Tiered is basically C1 & (C2 | JVMCI) minus all the odd cases with restrictions.
> 116: inline bool CompilerConfig::is_tiered() {
> 117:   assert((is_c1_simple_only() && is_c1_only()) || !is_c1_simple_only(), "c1 simple mode must imply c1-only mode");

Ditto, 


assert(!is_c1_simple_only() || is_c1_only(), "c1 simple mode must imply c1-only mode");

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17200#discussion_r1440379521
PR Review Comment: https://git.openjdk.org/jdk/pull/17200#discussion_r1440381032


More information about the hotspot-compiler-dev mailing list