krfkeith / sx-gcc

Automatically exported from code.google.com/p/sx-gcc
0 stars 0 forks source link

the "g++.dg/warn/huge-val1.C" test case fails if compiled with sx-g++ #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If we try to compile the "g++.dg/warn/huge-val1.C" test case with sx-gcc,
we get the following error: 

   huge-val1.C:8: error: 'HUGE_VAL' was not declared in this scope

The "HUGE_VAL" macro is defined in the SX's "math.h" library:

{{{
#ifndef HUGE_VAL
#if     defined(_FLOAT1)
#define HUGE_VAL        ((float)7.237005150000000000e+75)
#endif
#if     defined(_FLOAT2)
#define HUGE_VAL        ((float)5.94865747678613e+4931)
#endif
#if     defined(_FLOAT0)
#ifdef __STDC__
extern const double __huge_val;
#define HUGE_VAL (+__huge_val)
#else
extern double __huge_val;
#define HUGE_VAL (__huge_val)
#endif /* __STDC__ */
#endif /* defined(_FLOAT0) */
#endif /* HUGE_VAL */
}}}

The main reason why "HUGE_VAL" isn't defined is probably the fact that
"_FLOAT0" macro is not defined in sx-gcc (we should be using _FLOAT0 since
we are only supporting the IEEE floating-point format in sx-gcc).

Original issue reported on code.google.com by nou...@gmail.com on 2 Jun 2009 at 4:04

GoogleCodeExporter commented 9 years ago
After putting the "builtin_define ("_FLOAT0");" into the "sx.h" header, the 
test case
compiles fine. The issue is resolved in r286 revision of sx-gcc.

Original comment by nou...@gmail.com on 2 Jun 2009 at 4:16

GoogleCodeExporter commented 9 years ago

Original comment by nou...@gmail.com on 2 Jun 2009 at 4:19