Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8288754: GCC 12 fails to build zReferenceProcessor.cpp #9219

Closed
wants to merge 1 commit into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Jun 20, 2022

When compiling with GCC 12.1.1 (current in Fedora rawhide), the following warning-as-error is produced and breaks the build by default:

/home/test/shipilev-jdk/src/hotspot/share/gc/z/zReferenceProcessor.cpp: In member function 'oopDesc* ZReferenceProcessor::drop(oop, ReferenceType)':
/home/test/shipilev-jdk/src/hotspot/share/gc/z/zReferenceProcessor.cpp:270:22: error: '%s' directive argument is null [-Werror=format-overflow=]
  270 | log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The problem is over-zealous compiler seeing NULL from ShouldNotReachHere() block, and complaining about it. In this particular case, we can dodge this by returning a more reasonable constant on failure path.

(This thing should be more reasonably handled when ShouldNotReachHere() is somehow nonreturn-ed, but Hotspot style doc is still undecided on this).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8288754: GCC 12 fails to build zReferenceProcessor.cpp

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9219/head:pull/9219
$ git checkout pull/9219

Update a local copy of the PR:
$ git checkout pull/9219
$ git pull https://git.openjdk.org/jdk pull/9219/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9219

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9219.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 20, 2022

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 20, 2022
@openjdk
Copy link

openjdk bot commented Jun 20, 2022

@shipilev The following label will be automatically applied to this pull request:

  • hotspot-gc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Jun 20, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 20, 2022

Webrevs

@shipilev
Copy link
Member Author

Closed in favor of JDK 19 PR: openjdk/jdk19#47

@shipilev shipilev closed this Jun 20, 2022
@shipilev shipilev deleted the JDK-8288754-gcc12-zgc branch June 23, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant