<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Adding hotspot-compiler-dev, asd I don't think this is a javac
compiler issue?</p>
<p>Maurizio</p>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Subject:
</th>
<td>Invalid code generated by C2 compiler in OpenJDK 21</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Date: </th>
<td>Fri, 15 Dec 2023 11:12:15 +0100</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">From: </th>
<td>Antoine DESSAIGNE <a class="moz-txt-link-rfc2396E" href="mailto:antoine.dessaigne@gmail.com"><antoine.dessaigne@gmail.com></a></td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:compiler-dev@openjdk.org">compiler-dev@openjdk.org</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<div dir="ltr">Hello everyone,
<div><br>
</div>
<div>I've found an issue while migrating to OpenJDK 21. A valued
local variable (effectively final) has its value removed and
it throws a NullPointerException. Unfortunately, I cannot
provide the source code and the data to reproduce the issue,
and I couldn't create a smaller code snippet to show the
issue. That said, I'll happily show the code and perform many
tests during calls.</div>
<div><br>
</div>
<div>Here's what I did so far to diagnose the issue.</div>
<div><br>
</div>
<div>I bisected the repository to find where the regression
comes from. I found this commit 3696711efa5 [1] but it's a
merge so I bisected the branch and found 10737e168c9 [2].
Looking at this commit, I have no idea how it could introduce
this kind of regression.</div>
<div><br>
</div>
<div>Then, thanks to the guidance from Aleksey Shipilëv, I
tested many things</div>
<div>* Issue does *not* happen with the following
flags: -Xint, -XX:-TieredCompilation, -XX:TieredStopAtLevel=1, -XX:TieredStopAtLevel=2, -XX:TieredStopAtLevel=3</div>
<div>* Issue also happens with fastdebug builds of OpenJDK,
without crashing due to assertions</div>
<div>* Issue still happens in the latest version of the code
(commit b31454e3623)</div>
<div>* Issue happens no matter which GC is used, I tried
SerialGC, ParallelGC, G1GC, and ShenandoahGC</div>
<div><br>
</div>
<div>The tests were performed in Docker containers running on 4
different hosts.</div>
<div><br>
</div>
<div>Therefore it looks like C2 is generating an invalid
assembly code. Unfortunately, I'm not great with assembly and
the generated assembly is quite big (main code is around 20k).</div>
<div><br>
</div>
<div>Do you have an idea of why this is happening? Do you know
what test I can run? If one of you is available, we can
schedule calls for me to show you the code and my tests. Thank
you very much for your assistance.</div>
<div><br>
</div>
<div>Have a nice day,</div>
<div><br>
</div>
<div>Antoine DESSAIGNE</div>
<div><br>
</div>
<div>[1] <a href="https://github.com/openjdk/jdk/commit/3696711efa566fb776d6923da86e17b0e1e22964" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/commit/3696711efa566fb776d6923da86e17b0e1e22964</a></div>
<div>[2] <a href="https://github.com/openjdk/jdk/commit/10737e168c967a08e257927251861bf2c14795ab" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/commit/10737e168c967a08e257927251861bf2c14795ab</a></div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</body>
</html>