double and float in GCC

Segher Boessenkool
Thu Jun 23 13:40:00 GMT 2016

On Thu, Jun 23, 2016 at 02:03:38AM -0700, Kondi wrote:
> I built GCC toolchain for my custom CPU. My custom CPU have 32-bits floating
> point unit so I set DOUBLE_TYPE_SIZE 32, to prevent convertion from float to
> double. Additionally in newlib I define _DOUBLE_IS_32BITS. 
> When I ran the GCC test, buildin-math-4.c fails and exactly:
> if (sizeof(int)*__CHAR_BIT__ <= __DBL_MANT_DIG__) {

> The IF condition is met,

Assuming your ints are 32 bits (and your __CHAR_BIT__ is 8), this means
your __DBL_MANT_DIG__ is bigger than 32.  That's not consistent.


More information about the Gcc-help mailing list