> James E Wilson wrote: > These libgcc2 functions really are tied to modes, not to types. So if double > is SFmode, gcc will never call one of the *df* functions for it. Meanwhile, > some targets that make double be SFmode also make long double be DFmode, and > hence we do still need the *df* functions defined exactly as they are > currently defined in order for the long double support to work. Hence it would > be very wrong to redefine the *df* functions to use mode (SF) instead of mode > (DF) for any target.
- yes you would think so, but in fact what libgcc2.h actually does is: ... #elif MIN_UNITS_PER_WORD > 1 #define W_TYPE_SIZE (2 * BITS_PER_UNIT) #define Wtype HItype #define UWtype UHItype #define HWtype HItype #define UHWtype UHItype #define DWtype SItype #define UDWtype USItype #define __NW(a,b) __ ## a ## hi ## b #define __NDW(a,b) __ ## a ## si ## b ... #define __muldi3 __NDW(mul,3) #define __divdi3 __NDW(div,3) ... (which is fairly odd at best, and simply wrong worst-case) > If this is a simple matter of not being able to compile some of the functions > in libgcc2.c, one possible solution would be to avoid compiling them. You > could use the trick used in arm/t-symbian, which is to put them in > LIB1ASMFUNCS. - unfortunately, avoidance doesn't seem like a vote of confidence? > Otherwise, it isn't clear what the problem is, because libgcc2 has been using > these types without apparent problem for a very long time. If there is a > problem, you need to be clearer about what exactly the problem is. If the > problem is one of the bigger modes, then we can add ifdefs to control when it > is used. - fundamentally the problem is that libgcc is too fragile; when it works, it works by a consequence of a series of hacks that end-up reasonably guessing what the type-modes a particular target supports based on it's defined word size, which in general has no warranted correlation to a target's defined type sizes. - the proper fix is likely simply applying the method Richard used to correctly determine if a particular mode is required for a target based on the targets defined type-sizes, and then conditionally defining the corresponding functions for that mode based on it's known need, to the remaining of libgcc2's implementation. (which although relatively straight forward, most seem reluctant to consider touching something that is perceived to work, even if only by coincidence, if not actually avoiding it; this is what I believe Bjorn was volunteering to try to help to remedy in as painless way as possible, which suspect some if not many would welcome, I hope.)