jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 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 8 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 8 years ago

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