Remove unused local variable in MacroAssembler::sha512_update_sha_state on PPC

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 26
    • Component/s: hotspot

      Filed on behalf of Li Yang wb-ly878512@alibaba-inc.com

      'MacroAssembler::sha512_update_sha_state' in 'macroAssembler_ppc_sha.cpp' defines a local constant 'total_inis' that is never used:

      ```
      VectorRegister ini_a = VR10;
      VectorRegister ini_c = VR12;
      VectorRegister ini_e = VR14;
      VectorRegister ini_g = VR16;
      static const VectorRegister inis[] = {ini_a, ini_c, ini_e, ini_g};
      static const int total_inis = sizeof(inis)/sizeof(VectorRegister);
      ```

      The variable 'total_inis' is not referenced anywhere in the function. This triggers static analysis warnings (e.g. “unused variable” / “dead code”) and slightly reduces code clarity, although it has no impact on correctness or runtime behavior.

      The rest of the function relies only on 'total_hs' and the implicit relation between 'hs' and 'inis'. The unused 'total_inis' appears to be left over from an earlier version of the code or a refactoring.

      Proposed fix:
      Remove the unused local variable 'total_inis' and keep the existing logic unchanged.

      Potential impact:
      No functional impact: the variable is unused and only removed.
      Improves code cleanliness and avoids static analysis warnings.

            Assignee:
            Unassigned
            Reporter:
            Denghui Dong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: