RFR: 8342769: gcc port broken on HotSpot

Julian Waters jwaters at openjdk.org
Tue Oct 22 03:44:12 UTC 2024


On Tue, 22 Oct 2024 02:02:54 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Several areas in HotSpot are broken in the gcc port. These, with the exception of 1 rather big oversight withing SharedRuntime::frem and SharedRuntime::drem, are all minor correctness issues within the code. These mostly can be fixed with simple changes to the code. Note that I am not sure whether the SharedRuntime::frem and SharedRuntime::drem fix is correct. It may be that they can be removed entirely
>
> src/hotspot/os/windows/memMapPrinter_windows.cpp line 178:
> 
>> 176:     st->print("%s-%s", mapping_info._state_buffer.base(), mapping_info._type_buffer.base());
>> 177:     INDENT_BY(63);
>> 178:     st->print("%#11llx", reinterpret_cast<unsigned long long>(mem_info.BaseAddress) - reinterpret_cast<unsigned long long>(mem_info.AllocationBase));
> 
> What is the issue with const here?

More a correctness issue. The const is not required since the cast result is an rvalue unsigned long long. It's similar to something like a method's return type being marked as `const int get();` where the const doesn't really mean anything since there is no possible way for it to be modified

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21627#discussion_r1809803408


More information about the hotspot-dev mailing list