Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8279225

[arm32] C1 longs comparison operation destroys argument registers

    XMLWordPrintable

Details

    • b04
    • arm
    • linux

    Backports

      Description

        Several regression tests are failed on arm32 CPU if tiered compilation is enabled.

        The list includes
        java/math/BigDecimal/DivideMcTests
        java/util/Arrays/Sorting.java
        java/util/Arrays/SortingNearlySortedPrimitive.java
        java/util/concurrent/tck/JSR166TestCase
        java/util/stream/SliceOpTest.java
        etc

        It appears C1 comp_op for long operands destroys arguments registers:
        void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) {
        ....
              Register ylo = opr2->as_register_lo();
              Register yhi = opr2->as_register_hi();
              if (condition == lir_cond_equal || condition == lir_cond_notEqual) {
                __ teq(xhi, yhi);
                __ teq(xlo, ylo, eq);
              } else {
                __ subs(xlo, xlo, ylo); // <<< incorrect
                __ sbcs(xhi, xhi, yhi); // <<< incorrect
              }
        ...
        }

        The bug persist at all version of JDK since ARM32 code was opensourced.

        Attachments

          Issue Links

            Activity

              People

                snazarki Sergey Nazarkin
                snazarki Sergey Nazarkin
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: