-
Bug
-
Resolution: Fixed
-
P4
-
12
-
b10
-
ppc
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8224194 | 11.0.4 | Gustavo Romero | P4 | Resolved | Fixed | b04 |
The following compiler warning/error will be triggered when JVM is compiled with recent gcc compilers (>=7.3):
Compiling 395 files for BUILD_jdk.compiler.interim
In file included from /home/gromero/hg/jdk/jdk/src/hotspot/share/c1/c1_Compilation.hpp:29:0,
from /home/gromero/hg/jdk/jdk/src/hotspot/share/precompiled/precompiled.hpp:286:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp: In member function ‘void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck*, Label*, Label*, Label*)’:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp:595:100: warning: ‘data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gromero/hg/jdk/jdk/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp:2400:18: note: ‘data’ was declared here
ciProfileData* data;
^~~~
In file included from /home/gromero/hg/jdk/jdk/src/hotspot/share/c1/c1_Compilation.hpp:29:0,
from /home/gromero/hg/jdk/jdk/src/hotspot/share/precompiled/precompiled.hpp:286:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp:595:100: warning: ‘md’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gromero/hg/jdk/jdk/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp:2399:17: note: ‘md’ was declared here
ciMethodData* md;
^~
The following trivial fix will resolve the issue:
@@ -141637,7 +141637,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
}
ciMethodData* md;
- ciProfileData* data;
+ ciProfileData* data=0;
int mdo_offset_bias = 0;
if (should_profile) {
ciMethod* method = op->profiled_method();
Compiling 395 files for BUILD_jdk.compiler.interim
In file included from /home/gromero/hg/jdk/jdk/src/hotspot/share/c1/c1_Compilation.hpp:29:0,
from /home/gromero/hg/jdk/jdk/src/hotspot/share/precompiled/precompiled.hpp:286:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp: In member function ‘void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck*, Label*, Label*, Label*)’:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp:595:100: warning: ‘data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gromero/hg/jdk/jdk/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp:2400:18: note: ‘data’ was declared here
ciProfileData* data;
^~~~
In file included from /home/gromero/hg/jdk/jdk/src/hotspot/share/c1/c1_Compilation.hpp:29:0,
from /home/gromero/hg/jdk/jdk/src/hotspot/share/precompiled/precompiled.hpp:286:
/home/gromero/hg/jdk/jdk/src/hotspot/share/ci/ciMethodData.hpp:595:100: warning: ‘md’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gromero/hg/jdk/jdk/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp:2399:17: note: ‘md’ was declared here
ciMethodData* md;
^~
The following trivial fix will resolve the issue:
@@ -141637,7 +141637,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
}
ciMethodData* md;
- ciProfileData* data;
+ ciProfileData* data=0;
int mdo_offset_bias = 0;
if (should_profile) {
ciMethod* method = op->profiled_method();
- backported by
-
JDK-8224194 PPC64: Fix uninitialized variable in C1 LIR assembler code
-
- Resolved
-