Hi,

I'd like to discuss with you a topic related to a recent bootstrap failure of 
a couple of smaller embedded targets. The origin of the failure could be 
removed easily. In my opinion the question is simply, what is the best way to 
implement it?

Root of the problem is that libgcc2 presently does not consider target 
dependencies properly for smaller targets: Namely, for several smaller 
targets double is defined to be the same as float, or there possibly might be 
no support for long longs (>= 64 bits). Since libgcc2 explicitly refers to 
DI, DF or DC modes presently, gcc runs into problems when it tries to compile 
functions that use modes that are not implemented by the back-ends.

My suggestion in order to deal with this issue is to

change libgcc2.h such that it includes the target specific tm.h .
Establish a convention that, when the target machine header file defines 
symbols with the standard names

#define TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_DI SI
#define TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_TI DI
#define TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_XF SF
#define TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_DF SF
#define TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_DC SC

, the value that these macros expand to should substitute the definitions of 
e.g.

typedef         float           DFtype          __attribute__ ((mode (DF)));

Namely, I'd suggest to change libgcc2.h such that above line would read

#ifndef TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_DF
typedef         float           DFtype          __attribute__ ((mode (DF)));
#else
typedef         float           DFtype          
               __attribute__ ((mode (TARGET_SPECIFIC_SUBSTITUE_FOR_MODE_DF)));
#endif

I would be willing to implement it and present a patch for detailed 
discussion. However prior to starting, I'd appreciate comments. 
Looking forward to hearing from you.

Yours,

BJörn

Reply via email to