RFR: 8322806: Eliminate -Wparentheses warnings in aarch64 code
Stefan Karlsson
stefank at openjdk.org
Wed Jan 3 13:26:48 UTC 2024
On Wed, 3 Jan 2024 11:56:45 GMT, Aleksey Shipilev <shade 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?
I agree:
https://github.com/openjdk/jdk/pull/17210#pullrequestreview-1800130145
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17210#discussion_r1440448619
More information about the hotspot-dev
mailing list