-
Bug
-
Resolution: Fixed
-
P4
-
17, 18
-
b06
-
x86, x86_64
-
linux
I attempted to build OpenJDK on Fedora 34 with gcc-11.1.1-3.fc34.x86_64, but I saw following errors:
```
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/runtime/frame.inline.hpp:42,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:29:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp: In member function 'oop frame::saved_oop_result(RegisterMap*) const':
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp:231:42: error: 'this' pointer is null [-Werror=nonnull]
231 | oop* result_adr = (oop *)map->location(rax->as_VMReg());
| ^~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/code/vmreg.inline.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/asm/macroAssembler.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interp_masm.hpp:28,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interpreter.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:27:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/vmreg_x86.inline.hpp:28:14: note: in a call to non-static member function 'VMRegImpl* RegisterImpl::as_VMReg()'
28 | inline VMReg RegisterImpl::as_VMReg() {
| ^~~~~~~~~~~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/runtime/frame.inline.hpp:42,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:29:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp: In member function 'void frame::set_saved_oop_result(RegisterMap*, oop)':
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp:238:42: error: 'this' pointer is null [-Werror=nonnull]
238 | oop* result_adr = (oop *)map->location(rax->as_VMReg());
| ^~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/code/vmreg.inline.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/asm/macroAssembler.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interp_masm.hpp:28,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interpreter.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:27:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/vmreg_x86.inline.hpp:28:14: note: in a call to non-static member function 'VMRegImpl* RegisterImpl::as_VMReg()'
28 | inline VMReg RegisterImpl::as_VMReg() {
| ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
```
`Register` ( `RegisterImpl` ) is defined as a class, but it is used like numerical value. For example `rax` and `xmm0` are assigned to `0`. It is the cause of this error.
Logically, the code is fine, so we can avoid them to disable `-Wnonnull`.
```
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/runtime/frame.inline.hpp:42,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:29:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp: In member function 'oop frame::saved_oop_result(RegisterMap*) const':
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp:231:42: error: 'this' pointer is null [-Werror=nonnull]
231 | oop* result_adr = (oop *)map->location(rax->as_VMReg());
| ^~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/code/vmreg.inline.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/asm/macroAssembler.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interp_masm.hpp:28,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interpreter.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:27:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/vmreg_x86.inline.hpp:28:14: note: in a call to non-static member function 'VMRegImpl* RegisterImpl::as_VMReg()'
28 | inline VMReg RegisterImpl::as_VMReg() {
| ^~~~~~~~~~~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/runtime/frame.inline.hpp:42,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:29:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp: In member function 'void frame::set_saved_oop_result(RegisterMap*, oop)':
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/frame_x86.inline.hpp:238:42: error: 'this' pointer is null [-Werror=nonnull]
238 | oop* result_adr = (oop *)map->location(rax->as_VMReg());
| ^~~
In file included from /home/ysuenaga/github-forked/jdk/src/hotspot/share/code/vmreg.inline.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/asm/macroAssembler.hpp:31,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interp_masm.hpp:28,
from /home/ysuenaga/github-forked/jdk/src/hotspot/share/interpreter/interpreter.hpp:29,
from /home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp:27:
/home/ysuenaga/github-forked/jdk/src/hotspot/cpu/x86/vmreg_x86.inline.hpp:28:14: note: in a call to non-static member function 'VMRegImpl* RegisterImpl::as_VMReg()'
28 | inline VMReg RegisterImpl::as_VMReg() {
| ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
```
`Register` ( `RegisterImpl` ) is defined as a class, but it is used like numerical value. For example `rax` and `xmm0` are assigned to `0`. It is the cause of this error.
Logically, the code is fine, so we can avoid them to disable `-Wnonnull`.
- relates to
-
JDK-8270140 Improve Register class implementation
-
- Open
-
-
JDK-8269122 The use of "extern const" for Register definitions generates poor code
-
- Resolved
-
-
JDK-8271869 AArch64: build errors with GCC11 in frame::saved_oop_result
-
- Resolved
-
-
JDK-8291822 ARM32: Build errors with GCC 11 in frame::saved_oop_result
-
- Resolved
-
(1 links to)