United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6646019 array subscript expressions become top() with -d64
JDK-6646019 : array subscript expressions become top() with -d64

Details
Type:
Bug
Submit Date:
2007-12-29
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
solaris,linux
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10,7
Fixed Versions:
hs13 (b01)

Related Reports
Backport:
Backport:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
This assertion is observed at least on linux-i586/amd64 with both latest jdk6 (1.6.0_10-ea-b09) and jdk7 (1.7.0-ea-b24):
	#  Internal Error (/BUILD_AREA/jdk7/hotspot/src/share/vm/opto/matcher.cpp:1337), pid=16791, tid=1081244000
	#  Error: assert(false,"bad AD file")

It occurs only in -Xcomp mode.

Testcase and hs_err file are attached.
Also fails on sparc with -d64.

                                    

Comments
EVALUATION

For performance reasons, in 64 bit mode, C2 tries to narrow the type
of an array subscript expression to 32 bits. If at compile time, the
subscript, or the array length is deduced to be negative, the compiler
recognizes the impossibility of the value and the narrowing operation
uses a top() node to represent the expression.

At runtime, the array subscript operation is not reached because an
exception will be thrown first. However, the top() node
plays havoc with the C2 type system and should be avoided if the
conditions that generate it are recognized.

The sample program has code to allocate an array with a negative
length. Other tests show failures with negative array subscripts.
                                     
2008-01-09
EVALUATION

Bug was introduced by fix for 6589186.
                                     
2008-01-14



Hardware and Software, Engineered to Work Together