-
Couldn't load subscription status.
- Fork 15k
[Compiler-rt] Fix wrong assignment in compiler_rt #164713
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
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
Sorry for accidental ping everyone, I've made a mistake during rebase |
|
My previous approach, to move CWF to Subtypes, is wrong -- these tables have to be in-sync with respective tables in gcc (gcc/common/config/i386/i386-cpuinfo.h). Otherwise, this won't work due to indexes being not synced. As such, I left the |
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.
LGTM. Thanks!
| }; | ||
|
|
||
| enum ProcessorVendors { | ||
| enum ProcessorVendors : unsigned int { |
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.
Is this ISO-compliant C? In C17 standard 6.7.2.2 enum-specifier has no enum-base which I am afraid that is only a C++11 feature.
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.
Ok. enum-type-specifier is a C23 feature and only supported in gcc-13+. Is this : unsigned int important here and can we get rid of it in favor of compatibility with older compilers?
…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
…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
The `INTEL_CLEARWATERFOREST` belongs to `ProcessorTypes` enum, but it was assigned to `Subtype` value, leading to cpu_specific/cpu_dispatch not recognizing CWF. The type for `Subtype` and `Type` are changed to respective enums to guard against these sort of errors in the future
…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
The
INTEL_CLEARWATERFORESTbelonged toProcessorTypesenum, but it was assigned toSubtypevalue, leading to cpu_specific/cpu_dispatch not recognizing CWF. The type forSubtypeandTypeare changed to respective enums to guard against these sort of errors in the future