C on X86 : evaluation of expressions

Post Reply

Topic author
joukj
Master
Posts: 175
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

C on X86 : evaluation of expressions

Post by joukj » Mon Aug 07, 2023 8:14 am

Hi

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.


jreagan
VSI Expert
Master
Posts: 139
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: C on X86 : evaluation of expressions

Post by jreagan » Tue Aug 08, 2023 3:16 pm

Looks buggy to me. I thought we fixed all those (other than long double)

I'll add it to the list

John


Topic author
joukj
Master
Posts: 175
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

Re: C on X86 : evaluation of expressions

Post by joukj » Thu Nov 16, 2023 1:53 am

This problem is sloved in the new C compiler (X7.4-843)

thanks
Jouk

Post Reply