JDK-8160310 : HotSpot cannot be built with GCC 6
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-27
  • Updated: 2019-09-13
  • Resolved: 2017-11-28
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 10
10Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8160353 :  
JDK-8160354 :  
JDK-8160356 :  
JDK-8160357 :  
JDK-8160361 :  
JDK-8160363 :  
Description
http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-June/023637.html

HotSpot could not be built with misleading-indentation and shift-negative-value warining (error) on GCC 6.1.1 . 
And new SEGV and Internal Error are occurred.

So I think we have to fix new warnings and errors.
Comments
All subtasks have been closed. So I close this issue.
28-11-2017

ILW = Build fails, with gcc 6, use alternate compiler = HLM = P3
23-05-2017

Looking at Yasumasa's patch most of the issues seems to be in Compiler code so I assigned this to Compiler. Please create subtasks for Runtime and GC if all places are not fixed with a single patch.
22-05-2017

This does not seem to be a build problem, but an issue with the Hotspot source code. Moving bug accordingly.
26-01-2017

Priority needs to be reevaluated if this is to be fixed in JDK 9 post RDP1.
24-08-2016

Error #13: assert(0 <= i) failed: negative index
27-06-2016

Error #12: assert(discovered->is_oop_or_null()) failed: Expected an oop or NULL for discovered field at 0x0000000000000000
27-06-2016

Error #11 :SEGV at JNIHandleBlock::oops_do(OopClosure*)
27-06-2016

Error #10: assert(_in == (Node**)this) failed: Must not pass arg count to 'new'
27-06-2016

Error #9: assert(index < _size) failed: BitMap index out of bounds
27-06-2016

Error #8: narrowing conversion at type.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/opto/type.cpp:101:1: error: narrowing conversion of '(uint)Node::NotAMachineReg' from 'uint {aka unsigned int}' to 'int' inside { } [-Werror=narrowing] }; ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/opto/type.cpp:101:1: error: narrowing conversion of '(uint)Node::NotAMachineReg' from 'uint {aka unsigned int}' to 'int' inside { } [-Werror=narrowing] /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/opto/type.cpp:101:1: error: narrowing conversion of '(uint)Node::NotAMachineReg' from 'uint {aka unsigned int}' to 'int' inside { } [-Werror=narrowing] cc1plus: all warnings being treated as errors
27-06-2016

Error #7: invalid suffix on literal at preservedMarks.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/gc/shared/preservedMarks.cpp:51:29: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] assert(_stack.is_empty(), "stack expected to be empty, size = "SIZE_FORMAT, ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/gc/shared/preservedMarks.cpp:54:10: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] "stack expected to have no cached segments, cache size = "SIZE_FORMAT, ^ cc1plus: all warnings being treated as errors
27-06-2016

Error #6: invalid suffix on literal at packageEntry.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/packageEntry.cpp:300:16: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] st->print_cr("package entry "PTR_FORMAT" name %s module %s classpath_index " ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/packageEntry.cpp:301:86: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] INT32_FORMAT " is_exported_unqualified %d is_exported_allUnnamed %d " "next "PTR_FORMAT, ^ cc1plus: all warnings being treated as errors
27-06-2016

Error #5: narrowing conversion at os_linux.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/os/linux/vm/os_linux.cpp: In static member function 'static void* os::dll_load(const char*, char*, int)': /home/ysuenaga/OpenJDK/hs/hotspot/src/os/linux/vm/os_linux.cpp:1821:66: error: narrowing conversion of 'elf_head.Elf32_Ehdr::e_ident[4]' from 'unsigned char' to 'char' inside { } [-Werror=narrowing] arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL}; ~~~~~~~~~~~~~~~~~~~~~~~~~^ /home/ysuenaga/OpenJDK/hs/hotspot/src/os/linux/vm/os_linux.cpp:1821:93: error: narrowing conversion of 'elf_head.Elf32_Ehdr::e_ident[5]' from 'unsigned char' to 'char' inside { } [-Werror=narrowing] arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL}; ~~~~~~~~~~~~~~~~~~~~~~~~^ cc1plus: all warnings being treated as errors
27-06-2016

Error #4: invalid suffix on literal at moduleEntry.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:16: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT, ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:34: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT, ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:62: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT, ^ cc1plus: all warnings being treated as errors
27-06-2016

Error #3: uninitialized value at interp_masm_x86.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp: In member function 'void InterpreterMacroAssembler::increment_mdp_data_at(Register, int, bool)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized] Address data(mdp_in, constant); ^~~~ /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[4]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp: In member function 'void InterpreterMacroAssembler::increment_mdp_data_at(Register, Register, int, bool)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1388:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized] Address data(mdp_in, reg, Address::times_1, constant); ^~~~ /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1388:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1388:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[4]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp: In member function 'void InterpreterMacroAssembler::profile_called_method(Register, Register, Register)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized] Address data(mdp_in, constant); ^~~~ /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[4]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp: In member function 'void InterpreterMacroAssembler::profile_virtual_call(Register, Register, Register, bool)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[4]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp: In member function 'void InterpreterMacroAssembler::profile_ret(Register, Register)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp:1354:11: error: 'data.Address::_rspec.RelocationHolder::_relocbuf[4]' may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1plus: all warnings being treated as errors
27-06-2016

Error #2: uninitialized value at assembler_x86.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/assembler_x86.cpp: In static member function 'static Address Address::make_raw(int, int, int, int, relocInfo::relocType)': /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/assembler_x86.cpp:203:12: error: '*((void*)& rspec +32)' may be used uninitialized in this function [-Werror=maybe-uninitialized] return madr; ^~~~ /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/assembler_x86.cpp:203:12: error: '*((void*)& rspec +24)' may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/ysuenaga/OpenJDK/hs/hotspot/src/cpu/x86/vm/assembler_x86.cpp:203:12: error: '*((void*)& rspec +16)' may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1plus: all warnings being treated as errors
27-06-2016

Error #1: narrowing conversion at /altHashing.cpp ``` /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:227:43: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing] static const jint ONE_INT[] = { 0x83828180}; ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing] static const jint TWO_INT[] = { 0x83828180, 0x87868584}; ^ /home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2273740164u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing] lib/CompileJvm.gmk:193: recipe for target '/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/libjvm/objs/altHashing.o' failed gmake[4]: *** [/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/libjvm/objs/altHashing.o] Error 1
27-06-2016

Suggested fix: http://cr.openjdk.java.net/~ysuenaga/jdk9-for-gcc6/hotspot.01/
27-06-2016