JDK-8187676 : Disable uninitialized warnings for two files until proper fix available
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-09-19
  • Updated: 2019-09-13
  • Resolved: 2018-02-09
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 11
11 b01Fixed
Related Reports
Relates :  
Description
With gcc 7.1.1 from Fedora 26 on x86-64 there are warnings about the potential usage of maybe uninitialized memory in src/hotspot/cpu/x86/assembler_x86.cpp and in src/hotspot/cpu/x86/interp_masm_x86.cpp.

The problems arises from the class RelocationHolder which has the private fields:
  enum { _relocbuf_size = 5 };                                                                                                                                                                                                                 
  void* _relocbuf[ _relocbuf_size ];

and the default constructor for RelocationHolder does not set the elements to _relocbuf to NULL. This is an optimization, RelocationHolder is used *a lot* and setting the elements of RelocationHolder::_relocbuf to NULL in the default constructor might result in a performance penalty. Instead, all users of RelocationHolder::_relocbuf take care to not use uninitialized memory.

The problem continues because the class Address in src/hotspot/cpu/x86/assembler_x86.hpp has a private field:
  RelocationHolder _rspec;
and the default constructor for Address does not initialize _rspec._relocbuf (most likely for performance reasons). The class Address also has a default copy constructor, which will copy all the elements of _rspec._relocbuf, which will result in a read of uninitialized memory. However, this is a benign usage of uninitialized memory, since we take no action based on the content of the uninitialized memory (it is just copied byte for byte).
Comments
Taking over this bug. We need to silence these warnings now to be able to move ahead with the compiler upgrade project. When fixing JDK-8160404, these warnings should be disabled again.
09-02-2018

As we are working on upgrading toolchains (currently aiming at gcc 7.3), these warnings are now blockers. Bumping priority to same as the blocked JEP. I have verified that this proposed change is all that is needed for hotspot to compile cleanly with 7.3.
07-02-2018

Hi, Please note re-targeting this task to 11 for now (similar to related to 8160404). Request to kindly update Fix Version if any changes. Thanks.
02-12-2017

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2017-November/027719.html
28-11-2017

initial ILW = uninitialized memory warnings when building hotspot; when building hotspot with gcc7.1.1; no workaround = MLH = P4
20-09-2017