JDK-8310735 : Build failure after JDK-8310577 with GCC8
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2023-06-23
  • Updated: 2023-11-27
  • Resolved: 2023-06-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b04Fixed
Related Reports
Relates :  
Description
I see 
/net/usr.work/d003504/Workspace/OpenJDK/jdk/jdk/src/hotspot/share/oops/arrayOop.hpp:141:17: error: comparison is always true due to limited range of data type [-Werror=type-limits]
     assert(type >= 0 && type < T_CONFLICT, "wrong type");
            ~~~~~^~~~

At least on linux x86_64 and on linux s390x, using gcc8.

Reason: 
In share/utilities/globalDefinitions.hpp, this modification
- enum BasicType {
+ enum BasicType : u1 {
forced BasicType to be unsigned. As a consequence, at least the above comparison is always true. 


Comments
Changeset: e78fd466 Author: Jie Fu <jiefu@openjdk.org> Date: 2023-06-23 14:08:56 +0000 URL: https://git.openjdk.org/jdk/commit/e78fd46679182b10d726cde37d39a34d9cd9a10a
23-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14627 Date: 2023-06-23 13:45:21 +0000
23-06-2023

Thanks [~lucy]. I suggest removing '>= 0' conditions in the asserts since BasicType had been made to be unsigned. https://github.com/openjdk/jdk/pull/14627
23-06-2023

Sure. Build errors are bothering.
23-06-2023

I assigned it to myself to fix it as soon as possible. Hope you wouldn't mind it. Thanks.
23-06-2023

The simple fix would be to revert the change in this one line. But this would most likely undermine the intention of the original change. I have contacted Coleen directly (via mail) and asked her to have a look. I'm not sure in which timezone she lives. Might well be it's early morning for her. I would suggest to wait a few more hours.
23-06-2023

We also found this bug. So would you like to fix it, [~lucy]?
23-06-2023