Article View: gnu.gcc.bug
Article #2627problems when BITS_PER_UNIT == 1
From: Marty
Date: Thu, 11 May 1989 22:27
Date: Thu, 11 May 1989 22:27
51 lines
1896 bytes
1896 bytes
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
Technical Details
Message-ID:
<890511-152757-4322@Xerox>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!XEROX.COM!Leisner.HenrShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!XEROX.COM!Leisner.Henr From: Leisner.Henr@XEROX.COM (Marty) Newsgroups: gnu.gcc.bug Subject: problems when BITS_PER_UNIT == 1 Message-ID: <890511-152757-4322@Xerox> Date: 11 May 89 22:27:49 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 51