United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6209737 REGRESSION:Compilation error "local schedule failed (not retryable)" with simple loop
6209737 : REGRESSION:Compilation error "local schedule failed (not retryable)" with simple loop

Details
Type:
Bug
Submit Date:
2004-12-16
Status:
Resolved
Updated Date:
2010-12-08
Project Name:
JDK
Resolved Date:
2005-01-12
Component:
hotspot
OS:
linux,windows_xp
Sub-Component:
compiler
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
6

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

FULL OS VERSION :
Linux 2.4.22-1.2199.nptl #4 Fri Sep 24 15:48:45 BST 2004 i686 athlon i386 GNU/Linux
Windows XP

A DESCRIPTION OF THE PROBLEM :
A simple program (see code)  takes far longer to execute in java 1.5.0 with "-server" than with "-client". Running with the option "-XX:+PrintCompilation" indicates a compile failure when running with "-server":

starting
  1%      X::main @ 14 (39 bytes)
  1   COMPILE SKIPPED: local schedule failed (not retryable)
45104

Whether the failure occurs seems to depend on the number of iterations in the loop; for me, for COUNT=14562 and lower, my program outputs, say:

X
starting
1

whereas for COUNT=14563 and higher, I get:

starting
  1%      X::main @ 14 (39 bytes)
  1   COMPILE SKIPPED: local schedule failed (not retryable)
3





THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Executing the given code via:

java -server -XX:+PrintCompilation X

gives:

starting
  1%      X::main @ 14 (39 bytes)
  1   COMPILE SKIPPED: local schedule failed (not retryable)
34933


EXPECTED VERSUS ACTUAL BEHAVIOR :
Executing:

java -client -XX:+PrintCompilation X

gives no problem:

  1   b   java.lang.String::hashCode (60 bytes)
  2   b   java.lang.String::charAt (33 bytes)
starting
  1%  b   X::main @ 14 (39 bytes)
2298

Compiling and running in 1.4.2, I get no problem with either "-server" or  "-client". ie. for:

java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)

I get:

java -client -XX:+PrintCompilation X

giving:

  1   b   java.lang.String::charAt (33 bytes)
starting
  1%  b   X::main @ 14 (39 bytes)
2974

and

java -server -XX:+PrintCompilation X

giving:

starting
  1%      X::main @ 14 (39 bytes)
4

The problem seems dependent not only on the loop count, but on the presence of other elements of the code. For example, if the line printing "starting" is removed, in 1.5.0,

java -server -XX:+PrintCompilation X

gives:

  1%      X::main @ 6 (31 bytes)
141
REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class X {
    private static int COUNT = 1000000000;

    public static void main(String[] args) {
	System.out.println("starting");
	long start = System.currentTimeMillis();
	for (int i = 0; i < COUNT; i++) { }
	System.out.println(System.currentTimeMillis() - start);
    }
}
---------- END SOURCE ----------

Release Regression From : 1.4.2_06
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2004-12-16 21:32:33 GMT

                                    

Comments
SUGGESTED FIX

/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2004/20041221090925.nips.bug6209737/
###@###.### 2004-12-21 21:51:00 GMT
                                     
2004-12-21
EVALUATION

Problem is a failure to retry a compilation that failed
during (local) scheduling because a load subsumption (which
combined a subtract and a memory load into one instruction)
created a dependence cycle.  The program starts with
a subtract of a result of a method call and a memory load.
The call is anti-dependent on the load.
           
      call-f() <-anti- load-x
             \        /
              \      /
               v    v
                sub

On x86, the subsume-load instruction selection
combines the subtract and the load, creating an
unschedulable graph:

      call-f() <-anti-+
             \        |
              \       |
               v      |
                sub-of-load-x


C2 is supposed to retry the compilation with load-subsumption
disabled (for all loads.) Local scheduling noticed the situation
correctly and set the compilation failure reason to
       "retry_no_subsuming_loads",
but the global scheduler (gcm) unfortunately didn't check for this
and called:
       record_method_not_compilable("local schedule failed")
which caused the compilation to not be retried.

Fixed by having the global scheduler check for the retry failure.

###@###.### 2004-12-20 21:06:41 GMT
                                     
2004-12-20



Hardware and Software, Engineered to Work Together