This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/10844: Wrong computation on nan initialized vectors.


>Number:         10844
>Category:       c
>Synopsis:       Wrong computation on nan initialized vectors.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sun May 18 17:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christian Szegedy
>Release:        gcc (GCC) 3.2.2
>Organization:
>Environment:
gentoo Linux
>Description:
The following program outputs nan istead of 0:

#include <math.h>

int main()
{
   int n = 10;
   int i;
   double *w= (double*)malloc(sizeof(double)*n);
   double x;

   for( i=0 ; i<n ; i++ ) { w[i] = nan(""); }

   w[0] = .0;
   w[0] += .0;

   printf("%lg\n",w[0]);
   
   return 0;
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]