--- types.c.orig Tue May 14 17:45:46 2002 +++ types.c Wed Aug 28 01:59:38 2002 @@ -1624,7 +1624,20 @@ #ifdef EGCS TYPE_SIZE_UNIT (type) = NULL_TREE; #endif +/* The backend doesn't appear to expect types with precisions not a + multiple of BITS_PER_UNIT (such as a type of 5 bits, martin4*.pas). + E.g., force_fit_type() would turn a constant of -21 into +11 which + would be right when really operating on 5 bit types. However, since + the CPU operates on BITS_PER_UNIT (usually 8 bit) wide types, adding + 11 is not equivalent to subtracting 21. So let's just round up the + precision to a multiple of BITS_PER_UNIT. This should not actually + make the type bigger. (Packed arrays where it would matter are + handled differently above, anyway.) */ +#if 0 TYPE_PRECISION (type) = TREE_INT_CST_LOW (bits); +#else + TYPE_PRECISION (type) = ((TREE_INT_CST_LOW (bits) + BITS_PER_UNIT - 1) / BITS_PER_UNIT) * BITS_PER_UNIT; +#endif layout_type (type); } }