From 7be404a950c09b4190724887ad2b77aa80d2fb1f Mon Sep 17 00:00:00 2001
From: Dylan Tuttle <jdylantuttle@gmail.com>
Date: Fri, 13 Oct 2023 13:54:51 -0700
Subject: [PATCH] Eliminate tautological comparisons

Fix an AIX warning concerning tautological comparisons
(i.e. boolean comparisons which will always evaluate to the same
value) by eliminating them

Signed-off-by: Dylan Tuttle <jdylantuttle@gmail.com>
---
 runtime/compiler/control/J9Options.cpp | 2 +-
 runtime/compiler/env/VMJ9.cpp          | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/runtime/compiler/control/J9Options.cpp b/runtime/compiler/control/J9Options.cpp
index 0a069e43314..81f2ca33944 100644
--- a/runtime/compiler/control/J9Options.cpp
+++ b/runtime/compiler/control/J9Options.cpp
@@ -1566,7 +1566,7 @@ void J9::Options::preProcessMode(J9JavaVM *vm, J9JITConfig *jitConfig)
             {
             UDATA aggressivenessValue = 0;
             IDATA ret = GET_INTEGER_VALUE(argIndex, aggressiveOption, aggressivenessValue);
-            if (ret == OPTION_OK && aggressivenessValue >= 0)
+            if (ret == OPTION_OK && aggressivenessValue < LAST_AGGRESSIVENESS_LEVEL)
                {
                _aggressivenessLevel = aggressivenessValue;
                }
diff --git a/runtime/compiler/env/VMJ9.cpp b/runtime/compiler/env/VMJ9.cpp
index 6543531b98b..beec034a5a7 100644
--- a/runtime/compiler/env/VMJ9.cpp
+++ b/runtime/compiler/env/VMJ9.cpp
@@ -6589,9 +6589,9 @@ TR_J9VMBase::getInstanceFieldOffset(TR_OpaqueClassBlock * clazz, char * fieldNam
 TR_OpaqueClassBlock *
 TR_J9VM::getSuperClass(TR_OpaqueClassBlock * classPointer)
    {
-   J9Class * clazz = TR::Compiler->cls.convertClassOffsetToClassPtr(classPointer);
-   UDATA classDepth = J9CLASS_DEPTH(clazz) - 1;
-   return convertClassPtrToClassOffset(classDepth >= 0 ? clazz->superclasses[classDepth]: 0);
+   J9Class *clazz = TR::Compiler->cls.convertClassOffsetToClassPtr(classPointer);
+   UDATA classDepth = J9CLASS_DEPTH(clazz);
+   return convertClassPtrToClassOffset(classDepth >= 1 ? clazz->superclasses[classDepth - 1] : 0);
    }
 
 bool