I get the following:
Code: Select all
rumba-jj) cc/vers
VSI C X7.4-785 (GEM 50X65) on OpenVMS x86_64 V9.2-1
rumba-jj) ty test.c
#define DBL_M 1.7976931348623157e+308
double aaaa( double* x)
{
if ( 1.0/DBL_M > 0 && x[0] < 1.0/DBL_M )
return 8.0;
else
return 1.0;
}
7-AUG-2023 14:10:13
rumba-jj) cc/warn=disable=UNDERFLOW test.c
if ( 1.0/DBL_M > 0 && x[0] < 1.0/DBL_M )
................................^
%CC-E-CONSTFOLDNS, In this statement, the libraries on this platform do not yet
support compile-time evaluation of the constant expression "1.0/1.79769313486231
57e+308".
at line number 5 in file $DSTM:[JOUKJ.test.bugs.c.contstant]TEST.C;43
This looks to me that the compiler is trying to optimize. But even with /NOOP I get this. Why cannot the expression not be evaluated at run time if it not available at compiletime????
Of course a work-around is easy, but that I have different code foir AXP/IA64 and x86_64.