On Tue, Mar 30, 2010 at 3:29 PM, Joseph S. Myers <jos...@codesourcery.com> wrote: > On Tue, 30 Mar 2010, Paulo J. Matos wrote: > >> I have 16 BITS_PER_UNIT for this target, with 1 UNITS_PER_WORD. If I >> define FLOAT_TYPE_SIZE to be 32, then a float is an HFmode and it's >> not that gcc uses this. >> Defining BITS_PER_UNIT to 16 shouldn't generate problems inside the >> compiler given that GCC has generic treatment for these situations > > The GCC support for BITS_PER_UNIT values other than 8 is extremely > bitrotten and parts of it have never worked; there are no such targets in > the GCC source tree, no patches are tested for such targets and it is easy > to have hidden dependencies on 8-bit bytes. It is very inadvisable to > make your first port one to such an unusual target; substantially more GCC > experience and expertise is needed for doing a port to a system different > from all supported systems and that challenges hidden assumptions in the > GCC code. There will be a large amount of work finding and fixing issues > related to non-8-bit bytes that will need doing before you have a working > integer port, and all that should be done before you look at > floating-point issues. > > If seriously interested in fixing support for non-8-bit bytes, first > understand exactly what the C semantics are for such systems (including > how strings are meant to work). Then read my various past messages to the > GCC lists discussing aspects of support for such systems in GCC (which you > should be able to find for yourself in the list archives). Improving wide > string support for normal 8-bit-byte systems (so that optimization etc. > infrastructure can work with both wide and narrow strings) may be a useful > starting point for making some things work when the characters in narrow > strings are more than one host byte.
Thank you for all the discussion regarding the GCC support to 16bit targets. I had noticed already issues with wide-char strings which was another pending subject. :) I will be careful with gcc in this respect and make sure I start fixing issues regarding 'unusual' 16bit targets. -- PMatos