gccint: Portability

1 
1 2 GCC and Portability
1 *********************
1 
1 GCC itself aims to be portable to any machine where 'int' is at least a
1 32-bit type.  It aims to target machines with a flat (non-segmented)
1 byte addressed data address space (the code address space can be
1 separate).  Target ABIs may have 8, 16, 32 or 64-bit 'int' type.  'char'
1 can be wider than 8 bits.
1 
1  GCC gets most of the information about the target machine from a
1 machine description which gives an algebraic formula for each of the
1 machine's instructions.  This is a very clean way to describe the
1 target.  But when the compiler needs information that is difficult to
1 express in this fashion, ad-hoc parameters have been defined for machine
1 descriptions.  The purpose of portability is to reduce the total work
1 needed on the compiler; it was not of interest for its own sake.
1 
1  GCC does not contain machine dependent code, but it does contain code
1 that depends on machine parameters such as endianness (whether the most
1 significant byte has the highest or lowest address of the bytes in a
1 word) and the availability of autoincrement addressing.  In the
1 RTL-generation pass, it is often necessary to have multiple strategies
1 for generating code for a particular kind of syntax tree, strategies
1 that are usable for different combinations of parameters.  Often, not
1 all possible cases have been addressed, but only the common ones or only
1 the ones that have been encountered.  As a result, a new target may
1 require additional strategies.  You will know if this happens because
1 the compiler will call 'abort'.  Fortunately, the new strategies can be
1 added in a machine-independent fashion, and will affect only the target
1 machines that need them.
1