RFR: JDK-8306304: Fix xlc17 clang warnings in ppc and aix code

Tyler Steele tsteele at openjdk.org
Fri May 12 15:27:46 UTC 2023


On Fri, 12 May 2023 12:01:43 GMT, JoKern65 <duke at openjdk.org> wrote:

> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk on AIX , we run into various "warnings as errors".
> Many of those are in the aix or ppc specific codebase and could be addressed by small adjustments.
> A lot of those changes are in hotspot, some might be somewhere else in the OpenJDK C/C++ code.
> With this PR we address only the platform dependent code changes.

Marked as reviewed by tsteele (Committer).

src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp line 426:

> 424:   // Missing test if instr is commutative and if we should swap.
> 425:   if (right.value()->type()->as_LongConstant() &&
> 426:       (x->op() == Bytecodes::_lsub && right.value()->type()->as_LongConstant()->value() == -32768 ) ) {

I would prefer a shifted value here as it's usually more readable. If the compiler is being stubborn in its warnings, a comment explaining the magic value would be fine too.

src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp line 480:

> 478:   // Missing test if instr is commutative and if we should swap.
> 479:   if (right.value()->type()->as_IntConstant() &&
> 480:       (x->op() == Bytecodes::_isub && right.value()->type()->as_IntConstant()->value() == -32768) ) {

As above.

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

PR Review: https://git.openjdk.org/jdk/pull/13953#pullrequestreview-1424714446
PR Review Comment: https://git.openjdk.org/jdk/pull/13953#discussion_r1192505757
PR Review Comment: https://git.openjdk.org/jdk/pull/13953#discussion_r1192505876


More information about the hotspot-dev mailing list