-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8254072: AArch64: Get rid of --disable-warnings-as-errors on Windows+ARM64 build #530
Conversation
… '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
…nary minus operator applied to unsigned type, result still unsigned
…'<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
…'|': check operator precedence for possible error; use parentheses to clarify precedence
…ntf' : format string '%016lx' requires an argument of type 'unsigned long', but variadic argument 1 has type 'uintptr_t' ./src/hotspot/cpu/aarch64/frame_aarch64.cpp(686): note: consider using '%llx' in the format string ./src/hotspot/cpu/aarch64/frame_aarch64.cpp(686): note: consider using '%Ix' in the format string ./src/hotspot/cpu/aarch64/frame_aarch64.cpp(686): note: consider using '%I64x' in the format string
…y minus operator applied to unsigned type, result still unsigned m
…nary minus operator applied to unsigned type, result still unsigned
…4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data ./src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp(1837): warning C4267: 'initializing': conversion from 'size_t' to 'const unsigned int', possible loss of data
…4146: unary minus operator applied to unsigned type, result still unsigned
…4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data ./src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp(2901): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
…267: 'argument': conversion from 'size_t' to 'int', possible loss of data
…312: 'type cast': conversion from 'unsigned int' to 'address' of greater size
…267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data ./src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp(1370): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data ./src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp(1441): warning C4146: unary minus operator applied to unsigned type, result still unsigned ./src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp(1441): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
…23): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data ./src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp(1123): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
👋 Welcome back burban! A progress list of the required criteria for merging this PR into |
Mailing list message from Andrew Haley on hotspot-dev: On 06/10/2020 19:17, Bernhard Urban-Forster wrote:
Some of these don't look right. @@ -69,7 +69,7 @@ int compare_immediate_pair(const void *i1, const void *i2) Turns out this does work because ~0 is a signed quantity which is then IMO this warning: warning C4146: unary minus operator applied to unsigned type, result still unsigned should not be used. There is nothing wrong with negating an unsigned Please have a look to see how many of these diffs would go away with @@ -1524,7 +1524,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Generate stack overflow check Could this one be fixed by changing stack_shadow_zone_size() or @@ -1309,7 +1309,7 @@ class StubGenerator: public StubCodeGenerator { Definitely not. @@ -1367,7 +1367,7 @@ class StubGenerator: public StubCodeGenerator { Better to fix the type of size. The problem seems to be that it's -- |
…signed type, result still unsigned"
…267: 'argument': conversion from 'size_t' to 'int', possible loss of data ./src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp(1446): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data ./src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp(1654): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
…ws-arm64-warnings
Thank you Andrew for your comments!
Okay, added to the Makefile and reverted those changes.
The x86_64 backend and others do the same: jdk/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp Lines 2176 to 2178 in 5351ba6
So should we (1) do the same, (2) diverge or (3) fix all of them? For the remaining comments, I've updated the PR, please have another look. |
Mailing list message from Andrew Haley on hotspot-dev: On 08/10/2020 21:28, Bernhard Urban-Forster wrote:
I hate changing code just to silence compiler warnings. Occasionally, The problem with "fixing all of them" is that it's real work, because Whenever making changes to "shut the compiler up", as is the case In this case, we "know" that stack_shadow_zone_size() will fit into an -- |
…ws-arm64-warnings
Fine, but please assert If all this sounds a bit paranoid, that's because I am. Adding casts to shut up compilers is a very risky business, because often (if not in this case) the programmer doesn't understand the code well, and sprinkles casts everywhere. But casts disable compile-time type checking, and this leads to risks for future maintainability. I wonder if we should fix it in a better way, and use something like
I know this is additional work, but I promise we'll never need to have this conversation again. |
Done.
Full ACK and I appreciate your comments on this!
This sounds like a great idea to me. I assume it doesn't fit into the scope of this PR, therefore I've created JDK-8254856 to track it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build changes look fine now.
@lewurm 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:
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 206 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@magicus, @theRealAph) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@theRealAph does the PR look okay to you now? |
/integrate Thank you for the reviews, Magnus and Andrew! |
Would you mind to sponsor it @theRealAph or @magicus? |
/sponsor |
Hmm, I think you have to integrate it first. |
@theRealAph @lewurm Since your change was applied there have been 291 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit d2812f7. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Thank you Andrew. |
@lewurm
Did you test building this on any aarch64 platforms besides Windows? |
@magicus I did test the initial version of this PR on linux+arm64, but not the latest iteration. sorry about that 🙁 What is the policy here? Submit a revert right away or investigate a fix? |
@lewurm Open a new JBS issue with the bug. If you can find a fix in a short amount of time (which I would believe should be possible; probably just need a proper cast) it's acceptable to fix it directly. What amounts to a "short amount of time" is left to reasonable judgement; minutes to hours are okay, days are not. Otherwise, create an anti-delta (revert changeset) to back out your changes, and open yet another JBS issue for re-implementing them correctly. In this case, an alternative short-term fix could also be to remove the assert instead of backing out the entire patch. |
Builds cleanly on Linux/GCC or me. |
@theRealAph what gcc version? I can reproduce with $ gcc --version
gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008 which ships in Ubuntu 19.10 as default |
I organized this PR so that each commit contains the warning emitted by MSVC as commit message and its relevant fix.
Verified on
{hotspot,jdk,langtools}:tier1
, no failures.{hotspot,jdk,langtools}:tier1
, no (new) failures.--disable-warnings-as-errors
still works. Just mentioning this here, because it's yet another toolchain (Xcode / clang) that needs to be kept happy going forward.Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/530/head:pull/530
$ git checkout pull/530