This is the mail archive of the
mailing list for the GCC project.
How to define a built-in 24-bit type?
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 20 Jan 2012 15:48:16 +0100
- Subject: How to define a built-in 24-bit type?
avr-gcc implements a 24-bit scalar integer types __int24 and __uint24 in
avr.c:TARGET_INIT_BUILTINS like so:
tree int24_type = make_signed_type (GET_MODE_BITSIZE (PSImode));
tree uint24_type = make_unsigned_type (GET_MODE_BITSIZE (PSImode));
(*lang_hooks.types.register_builtin_type) (int24_type, "__int24");
(*lang_hooks.types.register_builtin_type) (uint24_type, "__uint24");
PSImode is defined in avr-modes.c:
FRACTIONAL_INT_MODE (PSI, 24, 3);
Is this the right definition of a built-in type?
The question is because __int24 shreds the compiler, see PR51527
So the question is if there is something missing or broken in the definition
above or if it's actually a flaw in the front-end.
For the __int128 there is much more code sprinkled over the compiler sources,
so maybe it's not that easy to introduce a new, built-in type completely in the