TCE target nonconforming definition of long long and intmax_t

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 7 06:59:19 PST 2021


Hello! I was digging around in stdint.h to do some implementation work
on C2x and I noticed that the TCE target seems to be nonconforming.

In C17, the implementation limits for intmax_t and uintmax_t are
specified by 7.20.2.5 as:

— minimum value of greatest-width signed integer type
INTMAX_MIN -(2^63 - 1)
— maximum value of greatest-width signed integer type
INTMAX_MAX 2^63 - 1
— maximum value of greatest-width unsigned integer type
UINTMAX_MAX 2^64 - 1

Similarly, the implementation limits for long long and unsigned long
long are specified by 5.2.4.2.1p1:

minimum value for an object of type long long int
LLONG_MIN -9223372036854775807 // -(2^63 - 1)
— maximum value for an object of type long long int
LLONG_MAX +9223372036854775807 // 2^63 - 1
— maximum value for an object of type unsigned long long int
ULLONG_MAX 18446744073709551615 // 2^64 - 1

However, the TCE target appears to set these to 32-bit limits, not
64-bit limits:

https://github.com/llvm/llvm-project/blob/2ab513cd3e0648806db7ed1f8170ad4a3d4e7749/clang/lib/Basic/Targets/TCE.h#L61

Is this target still being maintained? If so, what should be done
here? (I can file a bug report about this once we have a bug database
that can accept new content so we don't lose track of this.)

Thanks!

~Aaron


More information about the cfe-commits mailing list