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

Fix problems compiling with gcc 10 #6301

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

keithc-ca
Copy link
Member

Use a flexible array for RegisterDependencyGroup._dependencies, and promote architecture-specific fields so they don't follow that flexible array.

Fixes: eclipse-openj9/openj9#14219.

@keithc-ca
Copy link
Member Author

keithc-ca commented Jan 13, 2022

Windows is not cooperating:

D:\a\1\s\compiler/codegen/OMRRegisterDependency.hpp(215): warning C4200: nonstandard extension used: zero-sized array in struct/union [D:\a\1\s\build\fvtest\compilertest\testcompiler.vcxproj]
  D:\a\1\s\compiler/codegen/OMRRegisterDependency.hpp(215): note: This member will be ignored by a defaulted constructor or copy/move assignment operator
  omrportTest.cpp
D:\a\1\s\compiler\x\codegen/OMRRegisterDependency.hpp(65): error C2503: 'OMR::RegisterDependencyGroup': base classes cannot contain zero-sized arrays [D:\a\1\s\build\fvtest\compilertest\testcompiler.vcxproj]
  JBCodeCacheManager.cpp

And it seems the added assertion needs to be relaxed:

5: Test command: /home/vsts/work/1/s/build/jitbuilder/release/iterfib
5: Test timeout computed to be: 10000000
5: Assertion failed at /home/vsts/work/1/s/compiler/codegen/OMRRegisterDependency.hpp:67: numDependencies > 0
5: 	Number of dependencies must be positive

@keithc-ca
Copy link
Member Author

Updated to make allowances for MSVC and to relax the new assertion.

@keithc-ca
Copy link
Member Author

jenkins build all

@keithc-ca
Copy link
Member Author

Apparently, it's only GCC that supports extending a class containing a flexible array member: adjusted accordingly.

Longer term we ought to eliminate extensions to OMR::RegisterDependencyGroup so a flexible array member can be used properly with all compilers.

@keithc-ca
Copy link
Member Author

jenkins build all

@keithc-ca
Copy link
Member Author

Updated so clang is not treated as gcc.

@keithc-ca
Copy link
Member Author

jenkins build all

@AdamBrousseau
Copy link
Contributor

Jenkins build xlinux

@keithc-ca keithc-ca mentioned this pull request Jan 17, 2022
Use a flexible array for RegisterDependencyGroup._dependencies
(only for gcc), and promote architecture-specific fields so they don't
follow that array whose size is determined dynamically at runtime.

Signed-off-by: Keith W. Campbell <[email protected]>
@keithc-ca
Copy link
Member Author

jenkins build all

@dsouzai
Copy link
Member

dsouzai commented Jan 17, 2022

@jdmpapin do you mind reviewing this one?

@dsouzai
Copy link
Member

dsouzai commented Jan 17, 2022

As mentioned in the slack channel, zos build passing depends on #6292

@keithc-ca
Copy link
Member Author

jenkins build zos

@keithc-ca
Copy link
Member Author

@jdmpapin Do you have any concerns with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiling with gcc 10.3 hangs/crashes with JIT when running -version
4 participants