RFR: 8322806: Eliminate -Wparentheses warnings in aarch64 code
Aleksey Shipilev
shade at openjdk.org
Wed Jan 3 11:59:48 UTC 2024
On Tue, 2 Jan 2024 02:49:09 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.
>
> Testing: mach5 tier1
>
> Also ran mach5 tier1 with these changes in conjunction enabling -Wparentheses
> and other changes needed to make that work.
src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp line 198:
> 196: && fp() == other.fp()
> 197: && pc() == other.pc();
> 198: assert(!ret || (ret && cb() == other.cb() && _deopt_state == other._deopt_state), "inconsistent construction");
Well... Since `||` is short-cutting, then on the right side of `||`, we can be sure that `!ret` was `false` (shortcut not taken), which means `ret` was `true`, which means `ret &&` is redundant?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17210#discussion_r1440371143
More information about the hotspot-dev
mailing list