ReservedHeapSpace includes some code to support creating a compressed oops heap. This is currently unconditionally included and compiled. This is despite the code being inapplicable for 32bit builds, so just wasting some code space and build time for such. Further, some of this code is problematic in a 32bit build. For example, consider this line:
https://github.com/openjdk/jdk/blob/41ee582df8c65f2f26b21e46784cf0bc4ece0585/src/hotspot/share/memory/virtualspace.cpp#L559
{code:c++}
if (aligned_heap_base_min_address + size <= (char *)UnscaledOopHeapMax) {
{code}
UnscaledOopHeapMax is a a const uint64_t whose value is a 1 in bit 32 and 0s in all other bits. Conversion of this value to a 32bit pointer is implementation-defined. gcc discards the high bits, treating it as a conversion of zero to a pointer. Surprisingly, this triggers a -Wzero-as-null-pointer-constant warning (maybe with only some gcc versions?).
We should only include the compressed oops heap support for 64bit builds.
https://github.com/openjdk/jdk/blob/41ee582df8c65f2f26b21e46784cf0bc4ece0585/src/hotspot/share/memory/virtualspace.cpp#L559
{code:c++}
if (aligned_heap_base_min_address + size <= (char *)UnscaledOopHeapMax) {
{code}
UnscaledOopHeapMax is a a const uint64_t whose value is a 1 in bit 32 and 0s in all other bits. Conversion of this value to a 32bit pointer is implementation-defined. gcc discards the high bits, treating it as a conversion of zero to a pointer. Surprisingly, this triggers a -Wzero-as-null-pointer-constant warning (maybe with only some gcc versions?).
We should only include the compressed oops heap support for 64bit builds.
- blocks
-
JDK-8332189 Enable -Wzero-as-null-pointer-constant for gcc
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/5a4b1809
-
Review(master) openjdk/jdk/21484