jdk8u-dev icon indicating copy to clipboard operation
jdk8u-dev copied to clipboard

8329826: GCC 12 reports some compiler error when building jdk8

Open kuenking opened this issue 1 year ago • 6 comments
trafficstars

Env: ldd (GNU libc) 2.38 gcc (GCC) 12.3.1

Test the PR patch; Build release/fastdebug/slowdebug version pass

Reported issue : https://bugs.openjdk.org/browse/JDK-8329826


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8329826 needs maintainer approval
  • [x] Commit message must refer to an issue

Issue

  • JDK-8329826: GCC 12 reports some compiler error when building jdk8 (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/479/head:pull/479
$ git checkout pull/479

Update a local copy of the PR:
$ git checkout pull/479
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/479/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 479

View PR using the GUI difftool:
$ git pr show -t 479

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/479.diff

Webrev

Link to Webrev Comment

kuenking avatar Apr 09 '24 09:04 kuenking

Hi @kuenking, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user kuenking" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

bridgekeeper[bot] avatar Apr 09 '24 09:04 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Apr 09 '24 09:04 openjdk[bot]

@kuenking Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

openjdk[bot] avatar Apr 11 '24 07:04 openjdk[bot]

Webrevs

mlbridge[bot] avatar Apr 11 '24 07:04 mlbridge[bot]

The register issue is already being handled by the work ongoing in https://github.com/openjdk/jdk8u-dev/pull/357

I have not seen other failures. Are they specific to certain architectures?

We should not be introducing changes uniquely to 8u unless it is really necessary, so we need to look at this code in later JDKs.

gnu-andrew avatar Apr 15 '24 23:04 gnu-andrew

The register issue is already being handled by the work ongoing in #357

I have not seen other failures. Are they specific to certain architectures?

We should not be introducing changes uniquely to 8u unless it is really necessary, so we need to look at this code in later JDKs.

Thank you very much for your code review and also suggest. I found this problem when using gcc12 under the aarch64 architecture. After referring to https://github.com/openjdk/jdk8u-dev/pull/357, I still encounter other problems. I may need to remove the changes in adlc.make, the others are still having build issues in gcc12.

In file included from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/orderAccess.inline.hpp:45,
                 from /home//jdk8u-dev-master/hotspot/src/os/linux/vm/os_linux.inline.hpp:29,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/utilities/histogram.hpp:32,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/mutex.hpp:30,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/classfile/classLoaderData.hpp:32,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/typeArrayKlass.hpp:28,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/typeArrayOop.hpp:29,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/constantPool.hpp:32,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/method.hpp:33,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/frame.hpp:28,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/code/codeBlob.hpp:30,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/code/codeCache.hpp:28,
                 from /home//jdk8u-dev-master/hotspot/src/cpu/aarch64/vm/assembler_aarch64.inline.hpp:32,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/asm/assembler.inline.hpp:46,
                 from /home//jdk8u-dev-master/hotspot/src/share/vm/precompiled/precompiled.hpp:30:
In static member function ‘static void* OrderAccess::load_ptr_acquire(const volatile void*)’,
    inlined from ‘nmethod* volatile Method::code() const’ at /home//jdk8u-dev-master/hotspot/src/share/vm/oops/method.hpp:454:127,
    inlined from ‘static bool CompileBroker::compilation_is_complete(methodHandle, int, int)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1463:37,
    inlined from ‘static bool CompileBroker::compilation_is_complete(methodHandle, int, int)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1448:6,
    inlined from ‘static nmethod* CompileBroker::compile_method(methodHandle, int, int, methodHandle, int, const char*, Thread*)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1357:34:
/home//jdk8u-dev-master/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp:78:28: error: ‘long unsigned int __atomic_load_8(const volatile void*, int)’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   78 | { void* data; __atomic_load((void* const volatile *)p, &data, __ATOMIC_ACQUIRE); return data; }
      |               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Done with /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compilerOracle.cpp

Even though I modified gcc.make to fix the '-Werror=stringop-overflow=' problem. I also get the following error :

/home/jdk8u-dev-master/hotspot/src/share/vm/opto/type.cpp:2556:71: error: ‘this’ pointer is null [-Werror=nonnull]
 2556 |           ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();

About opto/type.cpp build error , which is not closely related to the architecture. so I refer to https://bugs.openjdk.org/browse/JDK-8301074. After analysis and evaluation, issue JDK-8301074 is not suitable for backporting to jdk8u. Therefore, the modification solution is for reference only.

I'll test it on x86 architecture, and I'll report back with the results.

kuenking avatar Apr 16 '24 01:04 kuenking

Mailing list message from Simon Tooke on jdk8u-dev:

mirabilos, we cannot see your comments until you either sign the OCA or post them on this mailing list.

On 4/16/24 10:38 AM, mirabilos wrote: -- Simon Tooke Principal Software Engineer - Java Platform Red Hat Canada, Inc. stooke at redhat.com

mlbridge[bot] avatar May 08 '24 09:05 mlbridge[bot]

Mailing list message from Thorsten Glaser on jdk8u-dev:

On Tue, 7 May 2024, Simon Tooke wrote:

mirabilos, we cannot see your comments until you either sign the OCA

Huh? Okay, I?ll have to find out what that is then?

or post them on this mailing list.

Funny: all posts on this mailing list regarding code issues have been ignored so far?

bye, //mirabilos -- Infrastrukturexperte ? Qvest Digital AG Am Dickobskreuz 10, D-53121 Bonn ? https://www.qvest-digital.com/ Telephon +49 228 54881-393 ? Fax: +49 228 54881-235 HRB AG Bonn 18196 ? USt-ID (VAT): DE274355441 Vorstand: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg Vorsitzender Aufsichtsrat: Peter N?then

mlbridge[bot] avatar May 08 '24 09:05 mlbridge[bot]

Mailing list message from Simon Tooke on jdk8u-dev:

On 4/15/24 9:38 PM, Kun Wang wrote:

On Tue, 9 Apr 2024 09:30:05 GMT, Kun Wang <kwang at openjdk.org> wrote:

Env: ldd (GNU libc) 2.38 gcc (GCC) 12.3.1

Test the PR patch; Build release/fastdebug/slowdebug version pass

Reported issue : https://bugs.openjdk.org/browse/JDK-8329826 The `register` issue is already being handled by the work ongoing in #357

I have not seen other failures. Are they specific to certain architectures?

The issue in? hotspot/src/share/vm/opto/type.cpp:2556 (potential NULL pointer) is common to all architectures.

I have see some other issues for GCC 14 (and the latest clang/Xcode), which I will bring up in a separate PR.

-- Simon Tooke Principal Software Engineer - Java Platform Red Hat Canada, Inc. stooke at redhat.com

mlbridge[bot] avatar May 08 '24 09:05 mlbridge[bot]

@kuenking Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

openjdk[bot] avatar May 10 '24 01:05 openjdk[bot]

@kuenking This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jun 07 '24 04:06 bridgekeeper[bot]

@kuenking This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Jul 05 '24 05:07 bridgekeeper[bot]

Issue with register keyword has been fixed by: https://github.com/openjdk/jdk8u-dev/pull/357

Issue in type.cpp seems like duplicate of these backports: https://github.com/openjdk/jdk8u-dev/pull/536 https://github.com/openjdk/jdk8u-dev/pull/552 (which also include tests)

zzambers avatar Aug 19 '24 10:08 zzambers