JDK-8254166 : Zero: return-type warning in zeroInterpreter_zero.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,11,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-07
  • Updated: 2020-11-11
  • Resolved: 2020-10-08
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 15 JDK 16 Other
11.0.10Fixed 15.0.2Fixed 16 b20Fixed openjdk8u282Fixed
Description
This readily manifests in 11u. It is obscured in HEAD JDK by disabled "return-type" warning (and changed ShouldNotReachHere/BREAKPOINT definition?) for Zero.

src/hotspot/cpu/zero/cppInterpreter_zero.cpp: In function intptr_t narrow(BasicType, intptr_t):
src/hotspot/share/utilities/breakpoint.hpp:43:32: warning: control reaches end of non-void function [-Wreturn-type]
 #define BREAKPOINT ::breakpoint()
                    ~~~~~~~~~~~~^~
src/hotspot/share/utilities/debug.hpp:130:3: note: in expansion of macro BREAKPOINT
   BREAKPOINT;                                                                     \
   ^~~~~~~~~~
src/hotspot/cpu/zero/cppInterpreter_zero.cpp:103:16: note: in expansion of macro ShouldNotReachHere
     default  : ShouldNotReachHere();
                ^~~~~~~~~~~~~~~~~~

cppInterpreter_zero.cpp was renamed to zeroInterpreter_zero.cpp by JDK-8239782.
Comments
Sure, I was just confused by your comment. I have some fixes in the pipeline which will enable the warning on 8u, which I'll return to after the CPU is out of the way.
19-10-2020

Ah. I don't think it fails with 8u, because JDK-8143245 had not removed the -Wno-return-type block yet. So while it does not fail in 8u, it is still a warning/problem and should be fixed in 8u.
19-10-2020

Zero has -Wno-return-type at present, so how does this fail without this patch? https://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/tip/make/linux/makefiles/zeroshark.make#l34
17-10-2020

Fix Request (8u) Same reason as for 15u. 15u patch applies with usual path reshuffling (15u patch already handles the rename). Patched JDK passes Linux x86_64 Zero bootcycle-images.
14-10-2020

Fix Request (11u) Same reason as for 15u. 15u patch applies cleanly (already handles the rename). Patched JDK passes Linux x86_64 Zero bootcycle-images.
14-10-2020

Fix Request (15u) This fixes default Zero build. The same 15u patch applies to a different file. 15u RFR (acked by Severin): https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-October/003946.html. Passes Linux x86_64 fastdebug Zero bootcycle build.
12-10-2020

Changeset: 7952c06b Author: Aleksey Shipilev <shade@openjdk.org> Date: 2020-10-08 08:10:55 +0000 URL: https://git.openjdk.java.net/jdk/commit/7952c06b
08-10-2020