This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

g77 on DSPs [was Re: `quad' printf format specifier ?]


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]