jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8325932: Replace ATTRIBUTE_NORETURN with direct [[noreturn]]

Open TheShermanTanker opened this issue 1 year ago • 14 comments

With clang 13 being the minimum required JDK-8325878, the noreturn bug that requires the ATTRIBUTE_NORETURN workaround now vanishes, and we can use [[noreturn]] directly within HotSpot. We should remove the workaround as soon as possible, given the chance


Progress

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

Issue

  • JDK-8325932: Replace ATTRIBUTE_NORETURN with direct [[noreturn]] (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17868

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

Using diff file

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

Webrev

Link to Webrev Comment

TheShermanTanker avatar Feb 15 '24 09:02 TheShermanTanker

:wave: Welcome back jwaters! 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.

bridgekeeper[bot] avatar Feb 15 '24 09:02 bridgekeeper[bot]

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

  • hotspot

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[bot] avatar Feb 15 '24 09:02 openjdk[bot]

Webrevs

mlbridge[bot] avatar Feb 15 '24 09:02 mlbridge[bot]

We should remove the workaround as soon as possible, given the chance.

Why the hurry? (especially seeing that JDK-8325878 is still open and being discussed)

tstuefe avatar Feb 15 '24 12:02 tstuefe

I believe "as soon as possible" should be "once JDK-8325878 is resolved" :)

Now, the reason to use [[noreturn]] instead of ATTRIBUTER_NORETURN macro is that IDEs recognize [[noreturn]] when doing static analysis on the code and that ATTRIBUTER_NORETURN was added as a workaround because a bug (crash) in clang < 12.

forax avatar Feb 15 '24 16:02 forax

I believe "as soon as possible" should be "once JDK-8325878 is resolved" :)

Now, the reason to use [[noreturn]] instead of ATTRIBUTER_NORETURN macro is that IDEs recognize [[noreturn]] when doing static analysis on the code and that ATTRIBUTER_NORETURN was added as a workaround because a bug (crash) in clang < 12.

Yes, I forgot to mention that this is only going in once the clang 13 requirement is integrated

TheShermanTanker avatar Feb 15 '24 16:02 TheShermanTanker

Thank you for the explanations.

tstuefe avatar Feb 16 '24 05:02 tstuefe

@TheShermanTanker This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8325932: Replace ATTRIBUTE_NORETURN with direct [[noreturn]]

Reviewed-by: kbarrett, dholmes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1193 new commits pushed to the master branch:

  • 0bb5ae645165b97527ecccf02308df6072c363d8: 8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException
  • 4d32c607a4b496bf2bb09e54167ecbbab5569a0c: 8322008: Exclude some CDS tests from running with -Xshare:off
  • e91492ab4333c61f39b50eb428fa932131a5b908: 8313674: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java should test for more block devices
  • 95a601316de06b4b0fbf6e3c7777be5d2a1ca978: 8332042: Move MEMFLAGS to its own include file
  • 5a4415a6bddb25cbd5b87ff8ad1a06179c2e452e: 8331858: [nmt] VM.native_memory statistics should work in summary mode
  • 4ba74475d44831c1fe49359458163cd1567e9619: 8326957: Implement JEP 474: ZGC: Generational Mode by Default
  • 7ce4a13c0a891e606480e138f4025ffa328a18b3: 8332130: RISC-V: remove wrong instructions of Vector Crypto Extension
  • ea5eb74a65f20ce28fa0a94ea851915d4a6f83da: 8326404: Assertion error when trying to compile switch with fallthrough with pattern
  • beea5305b071820e2b128a55c5ca384caf470fdd: 8331907: BigInteger and BigDecimal should use optimized division
  • 440782e0160f867f08afbec0abf48d557a522c72: 8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all
  • ... and 1183 more: https://git.openjdk.org/jdk/compare/1aae980c549741cf5fc5ca51f3c299285bafa49d...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

openjdk[bot] avatar Mar 13 '24 20:03 openjdk[bot]

@kimbarrett Is this good to go now that clang's minimum version has been set to 13?

TheShermanTanker avatar Mar 18 '24 12:03 TheShermanTanker

@TheShermanTanker 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 Apr 15 '24 16:04 bridgekeeper[bot]

@TheShermanTanker 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 May 13 '24 17:05 bridgekeeper[bot]

This seems to have gotten lost while waiting for JDK-8325878. Please re-open and update.

kimbarrett avatar May 13 '24 18:05 kimbarrett

/open

TheShermanTanker avatar May 14 '24 00:05 TheShermanTanker

@TheShermanTanker This pull request is now open

openjdk[bot] avatar May 14 '24 00:05 openjdk[bot]

Thanks Kim. Anyone else want to be the second reviewer?

TheShermanTanker avatar May 14 '24 10:05 TheShermanTanker

Thanks David and Kim for the reviews :)

TheShermanTanker avatar May 15 '24 00:05 TheShermanTanker

/integrate

TheShermanTanker avatar May 15 '24 00:05 TheShermanTanker

Going to push as commit 7b4ba7f90ab9ea5e1070c79534c587dad17d1bdd. Since your change was applied there have been 1193 commits pushed to the master branch:

  • 0bb5ae645165b97527ecccf02308df6072c363d8: 8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException
  • 4d32c607a4b496bf2bb09e54167ecbbab5569a0c: 8322008: Exclude some CDS tests from running with -Xshare:off
  • e91492ab4333c61f39b50eb428fa932131a5b908: 8313674: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java should test for more block devices
  • 95a601316de06b4b0fbf6e3c7777be5d2a1ca978: 8332042: Move MEMFLAGS to its own include file
  • 5a4415a6bddb25cbd5b87ff8ad1a06179c2e452e: 8331858: [nmt] VM.native_memory statistics should work in summary mode
  • 4ba74475d44831c1fe49359458163cd1567e9619: 8326957: Implement JEP 474: ZGC: Generational Mode by Default
  • 7ce4a13c0a891e606480e138f4025ffa328a18b3: 8332130: RISC-V: remove wrong instructions of Vector Crypto Extension
  • ea5eb74a65f20ce28fa0a94ea851915d4a6f83da: 8326404: Assertion error when trying to compile switch with fallthrough with pattern
  • beea5305b071820e2b128a55c5ca384caf470fdd: 8331907: BigInteger and BigDecimal should use optimized division
  • 440782e0160f867f08afbec0abf48d557a522c72: 8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all
  • ... and 1183 more: https://git.openjdk.org/jdk/compare/1aae980c549741cf5fc5ca51f3c299285bafa49d...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar May 15 '24 00:05 openjdk[bot]

@TheShermanTanker Pushed as commit 7b4ba7f90ab9ea5e1070c79534c587dad17d1bdd.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar May 15 '24 00:05 openjdk[bot]