JDK-8259049 : Uninitialized variable after JDK-8257513
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-01-04
  • Updated: 2025-01-13
  • Resolved: 2021-01-05
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 JDK 16 JDK 17
11.0.11Fixed 16.0.1Fixed 17 b04Fixed
Related Reports
Relates :  
Description
Backporting JDK-8257513 to JDK 11u triggered the following build failure:

[2021-01-04T09:54:55,894Z] workspace/open/src/hotspot/share/opto/compile.cpp: In member function 'bool Compile::ConstantTable::emit(CodeBuffer&) const':
[2021-01-04T09:54:55,894Z] workspace/open/src/hotspot/share/opto/compile.cpp:4136:83: error: 'last_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[2021-01-04T09:54:55,894Z]        address new_constant_addr = last_addr - ((n->outcnt() - 1) * sizeof(address));

Not sure why this is not a problem in mainline. Maybe we build with different flags.
Comments
Fix Request (JDK 16u): This is a follow-up fix for JDK-8257513. The fix is trivial and low risk. The patch applies cleanly to JDK 16u.
28-01-2021

The problem was introduced by JDK-8257513 which is currently not in 16u. I.e., if JDK-8257513 is backported to JDK 16u, we should backport this one as well.
11-01-2021

Is there any benefit considering this change for a 16u ?
08-01-2021

Fix Request (11u) This fixes the corner case in C2 and keeps codebases in sync (I see 11.0.11-oracle). Patch does not apply to 11u cleanly, because the code was moved. 11u RFR (acked by kvn): https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-January/004574.html
07-01-2021

Changeset: 9f151649 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-01-05 09:54:18 +0000 URL: https://git.openjdk.java.net/jdk/commit/9f151649
05-01-2021

ILW = Uninitialized variable, only affects debug code and does not trigger build failures in mainline, no workaround = MLH = P4
04-01-2021