[jdk8u-dev] RFR: 8207011: Remove uses of the register storage class specifier

Andrew John Hughes andrew at openjdk.java.net
Thu Mar 17 18:12:35 UTC 2022


On Thu, 17 Mar 2022 11:41:58 GMT, Dongbo He <dongbohe at openjdk.org> wrote:

> Hi,
> 
> Please review the backport of JDK-8207011 to 8u.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8207011
> Original commit: https://git.openjdk.java.net/jdk11u-dev/commit/98fb4f5e18a58727f51e00e3c08c0f5eac6748ec
> 8u webrev: http://cr.openjdk.java.net/~dongbohe/8207011/webrev.01/
> 
> This patch fixes build failure with gcc 11. Patch doesn’t apply cleanly, because JDK-8188813[1], JDK-8204301[2], JDK-8041415 [3], and JDK-8186089[4] does not exist in 8.
> + JDK-8188813 added register in orderAccess_aix_ppc.inline.hpp, orderAccess_linux_ppc.inline.hpp, orderAccess_linux_s390.inline.hpp, 
> and JDK-8204301 renamed these files to orderAccess_aix_ppc.inline.hpp, orderAccess_aix_ppc.hpp, orderAccess_linux_s390.hpp.
> + JDK-8041415 changed uint32 to uint32_t.
> + JDK-8186089 moved arena from allocation.cpp to arena.cpp.
> 
> Before patch:
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/home/jiangshunningy/install/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0/lto-wrapper
> Target: aarch64-unknown-linux-gnu
> Configured with: ../configure --prefix=/home/jiangshunningy/install --enable-languages=c,c++,fortran,go
> Thread model: posix
> Supported LTO compression algorithms: zlib
> gcc version 11.2.0 (GCC)
> 
> $ bash configure
> $ make images

This is an enhancement/cleanup fix and not appropriate for backporting to 8u.

Besides, this isn't the actual issue here. The baseline for 8u is C++98 (well, gnu++98 for GCC) where `register` is not deprecated. Newer versions of GCC have a later C++ standard as default so it has to be explicitly set (see [JDK-8151841](https://bugs.openjdk.java.net/browse/JDK-8151841))

The problem you're seeing here is that the ADLC code is not being passed that option. Indeed, it is not passed any of the extra C and C++ flags that may be specified to the build. This has gone unnoticed thus far because ADLC is a build tool that is used to generate files during the build and is not part of the shipped product.

I already have a bug for this - [JDK-8281098](https://bugs.openjdk.java.net/browse/JDK-8281098) - and a tested fix. I've not yet submitted it upstream as I'd like at least the build testing on PRs to be in place - PR #3 - so we can reduce the (already unlikely) chance it breaks anything.

I would appreciate it if you would withdraw this PR and wait for JDK-8281098 to be integrated. That should happen soon.

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

PR: https://git.openjdk.java.net/jdk8u-dev/pull/11


More information about the jdk8u-dev mailing list