This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g77 on DSPs [was Re: `quad' printf format specifier ?]
- To: craig at jcb-sc dot com
- Subject: g77 on DSPs [was Re: `quad' printf format specifier ?]
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Thu, 11 Feb 1999 10:09:17 +1300 (NZDT)
- Cc: Alan Lehotsky <lehotsky at sunspot dot tiac dot net>, jab3 at hotmail dot com,egcs at egcs dot cygnus dot com
- References: <19990209150626.21275.qmail@hotmail.com><199902091659.LAA14070@sunspot.tiac.net>
Alan Lehotsky writes:
>
> ADI's SHARC goes that even better. It also says
>
> sizeof(double) == sizeof(float) == sizeof(long) ==
> sizeof(int) == sizeof(short) == sizeof(char)
>
This is the same on the C4x DSP. The upshot is that sizeof(double) =
1, etc., since ISO C says sizeof(char) must return 1.
This behaviour breaks many programs, in particular the GNU binutils,
where a lot of horrible hackery was required for the C4x.
Closer to home, it breaks the g77 front end. In particular, there are
many assert statements in com.c of the form:
assert (ffetype_size (type) == sizeof (ffetargetInteger1));
In this case, the two types have the same number of bits but a
perceived different number of bytes.
Now I don't know if these test should be modified to check for the
same number of bits or if the g77 front end cannot cope with
architectures where the smallest addressable unit is 32 bits?
Michael.