https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Emilio Cobos Álvarez (:emilio) from comment #8) > Another point that someone made in the Mozilla bug tracker is that the ABI, > in the "Scalar Types" table, specifies that enums are represented as a > `signed fourbyte`. It doesn't apply to typed enums nor normal enums that don't fit into the 4 bytes, such as enum E { -9223372036854775807LL, 9223372036854775807LL }; etc. typed enums have a fixed underlying type and that is what they use, in your case uint8_t. > I'm not sure that applies to typed enums. But just in case, if it does, the > ABI may require sign/zero-extending these too? > > Looking at https://bugs.llvm.org/show_bug.cgi?id=12207, which might be a > dupe of the LLVM bug I just filed, doesn't make me very hopeful of LLVM > changing their behavior here. What really matters is what does the psABI say, and as you can see above clarified from one of the ABI authors, there is intentionally no zero or sign extension of shorter arguments. So LLVM has a bug and that bug should be fixed in there, not worked around in other compilers.