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

[TESTBUG] Some forceEarlyReturn00* tests failed due to compiler optimization

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b09

      Description

      Following tests which were compiled by GCC 10.2 failed.

        - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn004/forceEarlyReturn004.java
       
       - vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java

      They have native module, and they are commented as below:

      ```
         // execute infinite loop to be sure that thread in native method
         while (always_true)
         {
             // Need some dummy code so the optimizer does not remove this loop.
             dummy_counter = dummy_counter < 1000 ? 0 : dummy_counter + 1;
         }
         // The optimizer can be surprisingly clever.
         // Use dummy_counter so it can never be optimized out.
         // This statement will always return 0.
         return dummy_counter >= 0 ? 0 : 1;
      ```

      C compiler maybe eliminate this loop. We should not consider compiler optimization at this point with other solution.

        Attachments

          Activity

            People

            Assignee:
            ysuenaga Yasumasa Suenaga
            Reporter:
            ysuenaga Yasumasa Suenaga
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: