-
Couldn't load subscription status.
- Fork 15k
[compiler-rt] fix gcc 12 support by removing enum-type-specifier #165034
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
Conversation
|
This isn't fine sadly - the signedness is platform specific. This needs to be preserved. I think that requiring GCC 13+ is acceptable. This is not building LLVM, it is target code. |
Sorry if I didn't make it clear. I am trying to say that the enum doesn't need to be |
But it does. The recent change changed the struct member from |
|
Thanks @yuxuanchen1997 for pointing out that using typed enums is c23, I missed that. My goal with introducing the enum was to prevent errors like the one I fixed in the PR with CWF. I think we could keep the enum as an argument type, revert to unsigned int in the struct, and cast when calling the function. Would that be okay? |
Would be in favor of that solution. |
Thanks. That would be ok for me. |
Yeah, that would be fine. I don't have a strong opinion between the two as long as the ABI is not changed. |
|
Alright, I can file a PR with a fix shortly |
Double checking this... You probably still have (some theoretical) ABI issues if the enums are used as arguments to |
Correct, but the members of the structure is more what I was concerned about. The other functions should be fine (they shouldn't be used outside of the module). |
|
Here's a PR #165048 |
…tion (#165048) Typed enums are c23 features and are too new to be used. This PR restores the types in the `__processor_model` struct back to `unsigned int`, removes typed enums, and uses the enum in the function as a variable that's later assigned to a struct in order to prevent errors fixed initially here: #164713 See #165034 for more background
…nly in function (#165048) Typed enums are c23 features and are too new to be used. This PR restores the types in the `__processor_model` struct back to `unsigned int`, removes typed enums, and uses the enum in the function as a variable that's later assigned to a struct in order to prevent errors fixed initially here: #164713 See llvm/llvm-project#165034 for more background
…tion (llvm#165048) Typed enums are c23 features and are too new to be used. This PR restores the types in the `__processor_model` struct back to `unsigned int`, removes typed enums, and uses the enum in the function as a variable that's later assigned to a struct in order to prevent errors fixed initially here: llvm#164713 See llvm#165034 for more background
…tion (llvm#165048) Typed enums are c23 features and are too new to be used. This PR restores the types in the `__processor_model` struct back to `unsigned int`, removes typed enums, and uses the enum in the function as a variable that's later assigned to a struct in order to prevent errors fixed initially here: llvm#164713 See llvm#165034 for more background
This
unsigned inthere is a new addition introduced in #164713 and doesn't compile under older (<13) gcc (see godbolt), which LLVM officially supports from 7.4+. This change should be fine as none of the enum values are negative.