Leisner.Henr@XEROX.COM (Marty) (05/12/89)
I'm writing a machine description for the TI34010.
I got a minimal description together, made a cross compiler with GCC 1.35
on a sun386i.
After spending a day defining enough stuff to run the compiler, a got an
abort() in stor-layout.c/layout_type() for a REAL_TYPE.
Tracing through it, I found out the following:
My tm.h says:
/* number of bits in an addressible storage unit */
#define BITS_PER_UNIT 1 /* ti 34010 is a bit addressable processor with
variable size fields */
The following code in layout_type triggered abort():
case REAL_TYPE:
{
register int prec = TYPE_PRECISION (type);
if (prec <= GET_MODE_BITSIZE (SFmode))
TYPE_MODE (type) = SFmode;
else if (prec <= GET_MODE_BITSIZE (DFmode))
TYPE_MODE (type) = DFmode;
else
abort ();
}
GET_MODE_BITSIZE(x) is defined in rtl.h as
/* Get the size in bits of an object of mode MODE. */
#define GET_MODE_BITSIZE(MODE) (BITS_PER_UNIT * mode_size[(int)(MODE)])
mode_size[MODE] returns # of bytes in MODE.
My best patch I see is to define:
#define GET_MODE_BITSIZE(MODE) (8 * mode_size[(int)(MODE)])
since mode_size is defined in bytes.
I'm concerned there may be other assumptions in other places that
BITS_PER_UNIT == 8 (all the current machine descriptions have it).
Am I on target? I'm making the change right now -- does it seem
reasonable.
marty
ARPA: leisner.henr@xerox.com
GV: leisner.henr
NS: martin leisner:wbst139:xerox
UUCP: hplabs!arisia!leisner