[8u] PRF:8207011 :Remove uses of the register storage class specifier

hedongbo hedongbo at huawei.com
Wed Feb 23 06:33:54 UTC 2022


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
/home/jiangshunningy/hedongbo/jdk8u-dev/hotspot/src/share/vm/adlc/dict2.cpp:286:17: error: ISO C++17 does not allow 'register' storage class specifier [-Werror=register]
  286 |   register char c, k = 0;
      |                 ^
/home/jiangshunningy/hedongbo/jdk8u-dev/hotspot/src/share/vm/adlc/dict2.cpp:286:20: error: ISO C++17 does not allow 'register' storage class specifier [-Werror=register]
  286 |   register char c, k = 0;
      |                    ^
/home/jiangshunningy/hedongbo/jdk8u-dev/hotspot/src/share/vm/adlc/dict2.cpp:287:16: error: ISO C++17 does not allow 'register' storage class specifier [-Werror=register]
  287 |   register int sum = 0;
      |                ^~~
/home/jiangshunningy/hedongbo/jdk8u-dev/hotspot/src/share/vm/adlc/dict2.cpp:288:24: error: ISO C++17 does not allow 'register' storage class specifier [-Werror=register]
  288 |   register const char *s = (const char *)t;
      |                        ^
...

After patch:
Build succeeded.

[1] https://bugs.openjdk.java.net/browse/JDK-8188813
[2] https://bugs.openjdk.java.net/browse/JDK-8204301
[3] https://bugs.openjdk.java.net/browse/JDK-8041415
[4] https://bugs.openjdk.java.net/browse/JDK-8186089

Thanks,
hedongbo


More information about the jdk8u-dev mailing list