JDK-6538523 : openjdk b10 fastdebug build fails on Solaris Express with Sun C++ 5.8
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: other
  • CPU: x86
  • Submitted: 2007-03-25
  • Updated: 2012-10-08
  • Resolved: 2007-04-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Description
Compiler : /usr/bin/CC
CC -V: CC: Sun C++ 5.8 Patch 121018-07 2006/11/01
Platform : SunOS solaris-devx 5.11 snv_55b i86pc i386 i86pc

CC -DSOLARIS -DSPARC_WORKS -DIA32 -DUSE_PRAGMA_IDENT_HDR -DUSE_PRAGMA_IDENT_SRC -DASSERT -DFASTDEBUG -DCHECK_UNHANDLED_OOPS -I../generated/adfiles -I../generated/jvmtifiles -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/asm -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/ci -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/code -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/compiler -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_implementation -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_implementation/parallelScavenge -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_implementation/shared -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/interpreter -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/libadt -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/opto -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/prims -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/runtime -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/services -I/export/home/openjdk/builds/b10/hotspot/src/share/vm/utilities -I/export/home/openjdk/builds/b10/hotspot/src/cpu/i486/vm -I/export/home/openjdk/builds/b10/hotspot/src/os/solaris/vm -I/export/home/openjdk/builds/b10/hotspot/src/os_cpu/solaris_i486/vm -I../generated -DHOTSPOT_BUILD_VERSION="\"1.7.0-ea-fastdebug-b10\"" -DHOTSPOT_BUILD_TARGET="\"fastdebug\"" -DHOTSPOT_BUILD_USER="\"openjdk\"" -DHOTSPOT_RELEASE_VERSION="\"1.7.0\"" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DCOMPILER2 -DSOLARIS_7_OR_LATER  /export/home/openjdk/builds/b10/hotspot/src/os_cpu/solaris_i486/vm/solaris_i486.il -features=no%split_init -D_Crun_inline_placement -library=%none -KPIC -mt  -xtarget=pentium  -xO3 -g0 -DVM_LITTLE_ENDIAN  -features=no%except   -DDTRACE_ENABLED -c -o accessFlags.o /export/home/openjdk/builds/b10/hotspot/src/share/vm/utilities/accessFlags.cpp 
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/utilities/exceptions.hpp", line 55: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/genOopClosures.hpp", line 106: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/klass.hpp", line 268: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/universe.hpp", line 233: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/klassVtable.hpp", line 140: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/klassVtable.hpp", line 151: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/cpCacheOop.hpp", line 112: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/constantPoolOop.hpp", line 365: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/constMethodOop.hpp", line 157: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/constMethodOop.hpp", line 162: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/instanceKlass.hpp", line 503: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/oops/instanceKlass.hpp", line 732: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/vmSymbols.hpp", line 633: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/vmSymbols.hpp", line 654: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/runtime/jniHandles.hpp", line 154: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/runtime/jniHandles.hpp", line 163: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/runtime/jniHandles.hpp", line 171: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/concurrentMarkSweepGeneration.hpp", line 667: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/memory/cardTableModRefBS.hpp", line 252: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/services/lowMemoryDetector.hpp", line 119: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp", line 24: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp", line 25: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp", line 41: Error: Overloading ambiguity between "oop::operator!=(void*) const" and "operator!=(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp", line 42: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
"/export/home/openjdk/builds/b10/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp", line 43: Error: Overloading ambiguity between "oop::operator==(void*) const" and "operator==(int, int)".
Compilation aborted, too many Error messages.
make[8]: *** [accessFlags.o] Error 1
make[8]: Leaving directory `/export/home/openjdk/builds/b10/control/build/solaris-i586-fastdebug/hotspot/outputdir/solaris_i486_compiler2/fastdebug'
make[7]: *** [the_vm] Error 2
make[7]: Leaving directory `/export/home/openjdk/builds/b10/control/build/solaris-i586-fastdebug/hotspot/outputdir/solaris_i486_compiler2/fastdebug'
make[6]: *** [fastdebug] Error 2
make[6]: Leaving directory `/export/home/openjdk/builds/b10/control/build/solaris-i586-fastdebug/hotspot/outputdir'
make[5]: *** [generic_build2] Error 2
make[5]: Leaving directory `/export/home/openjdk/builds/b10/hotspot/make'
make[4]: *** [fastdebug] Error 2
make[4]: Leaving directory `/export/home/openjdk/builds/b10/hotspot/make'
make[3]: *** [hotspot-build] Error 2
make[3]: Leaving directory `/export/home/openjdk/builds/b10/control/make'
make[2]: *** [generic_debug_build] Error 2
make[2]: Leaving directory `/export/home/openjdk/builds/b10/control/make'
make[1]: *** [fastdebug_build] Error 2
make[1]: Leaving directory `/export/home/openjdk/builds/b10/control/make'
make: *** [dev-build] Error 2

Comments
SUGGESTED FIX As Tom Rodriguez points out, the smallest fix is to actually declare operator==(intptr_t) and operator!=(intptr_t) so that it is directly applicable, and hence most viable, and so removes the ambiguity.
05-04-2007

EVALUATION The base CC 5.8 doesn't correctly detect ambiguities when resolving the appropriate overloaded operator to invoke. This was fixed via CR 6251919 and was first patched by 121018-03. In the debug build oop is a class rather than a typedef for a simple pointer type. As a result various conversion operators and cast operators are needed. The main ambuiguity arises where an oop is compared against NULL (which is defined as 0 - zero). The problem arises because oop defines a cast operator for intptr_t which is basically a cast to int - and this allows an oop and zero to be compared directly. However, oop also defines operator!=(void*) and operator==(void*), and there is an automatic conversion from zero to void*. So, for example, the compiler has a choice between doing: a) oop -> int, then use the built-in operator!=(int, int); or b) 0 -> void*, then use the overloaded operator(!=(void*) As the number of conversions is the same, neither of these choices results in a more viable method when performing resolution and so the call is ambiguous and the compiler rejects it.
02-04-2007

SUGGESTED FIX The smallest fix is to remove the cast operator for intprt_t so that there is no conversion from oop to int/long. In the cases where that conversion is needed we must explicitly perform the conversion the old operator used to do, which is to first cast the oop to oopDesc*, so (intptr_t) someOop becomes (intptr_t)(oopDesc*)someOop Other ambiguities can be resolved using casts directly. In places we end up with ugly triple casts.
02-04-2007