RFR: 8377798: Hotspot build on macOS aarch64 with unused-functions warning reports some unused functions
Matthias Baesken
mbaesken at openjdk.org
Thu Feb 19 15:40:28 UTC 2026
On Thu, 19 Feb 2026 15:31:24 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:
>> We currently set a warning for unused functions for gcc and clang, but later disable it for clang in the libjvm build.
>> See
>> https://github.com/openjdk/jdk/blob/master/make/hotspot/lib/CompileJvm.gmk#L105
>>
>> I checked why it might be disabled for clang and there are a few functions/methods reported as unused, probably we can remove some or all of those ?
>>
>> macOS aarch64 product build shows:
>>
>>
>> /myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:179:20: warning: unused function 'is_thread_local' [-Wunused-function]
>> static inline bool is_thread_local(ConstBufferPtr buffer) {
>> ^
>> /myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:184:20: warning: unused function 'is_virtual_thread_local' [-Wunused-function]
>> static inline bool is_virtual_thread_local(ConstBufferPtr buffer) {
>> ^
>> 2 warnings generated.
>> /myjdk/jdk/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp:197:20: warning: unused function 'jfr_is_started_on_command_line' [-Wunused-function]
>> static inline bool jfr_is_started_on_command_line() {
>> ^
>> 1 warning generated.
>> /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:61:20: warning: unused function 'sp_in_stack' [-Wunused-function]
>> static inline bool sp_in_stack(const JfrSampleRequest& request, JavaThread* jt) {
>> ^
>> /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:69:20: warning: unused function 'update_interpreter_frame_sender_pc' [-Wunused-function]
>> static inline void update_interpreter_frame_sender_pc(JfrSampleRequest& request, intptr_t* fp) {
>> ^
>> /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:79:23: warning: unused function 'interpreter_frame_return_address' [-Wunused-function]
>> static inline address interpreter_frame_return_address(const JfrSampleRequest& request) {
>> ^
>> /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:93:20: warning: unused function 'update_frame_sender_sp' [-Wunused-function]
>> static inline void update_frame_sender_sp(JfrSampleRequest& request, intptr_t* fp) {
>> ^
>> /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:101:20: warning: unused function 'update_sp' [-Wunused-function]
>> static inline void update_sp(JfrSampleRequest& request, int frame_size) {
>> ^
>> /myjdk/jdk...
>
> src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 99:
>
>> 97: }
>> 98:
>> 99: static inline Address at_rsp() {
>
> Couldn't you also remove it for riscv?
That's a good point ! I saw this too when preparing the change but was not sure about including it because the change is about what I saw on macOS aarch64 when testing the unused-functions warning .
But technically you are right, most likely the riscv method can be removed too (not sure if in this PR) .
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29695#discussion_r2828582759
More information about the hotspot-jfr-dev
mailing list