This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1.1 Release
- To: egcs-bugs at cygnus dot com
- Subject: Re: egcs-1.1.1 Release
- From: Gerhard Heinzel <ghh at mpq dot mpg dot de>
- Date: Mon, 7 Dec 1998 12:38:33 +0100 (MET)
On Fri, 4 Dec 1998, Jeffrey A Law wrote:
> We are pleased to announce the release of egcs-1.1.1.
....
>
> egcs-1.1.1 is a minor update to the egcs-1.1 compiler to fix several
> serious problems in egcs-1.1.
Sorry to report again failure to correctly compile the short test program
included below, when using the options
-march=i686 -O
(Complier: gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release))
If this bug cannot be fixed, I propose to disable the -march=i686 option,
since producing spurious wrong code without a warning is about the worst
thing a compiler can do.
Cheers
Gerhard
#include <stdio.h>
#include <math.h>
#define SIZE 10
int
main (void)
{
int i, j, k;
double a[SIZE * SIZE], ainv[SIZE * SIZE];
double diff, sum, soll, maxd;
/* matrix addressing : a(i,j) = a[n*i+j] */
/* Normally here 'a' is a double matrix and 'ainv' its inverse */
/* For testing, set 'a' and 'ainv' as unity matrices */
for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
a[i * SIZE + j] = ainv[i * SIZE + j] = ((i == j) ? 1 : 0);
/* compute the product a*ainv element by element and compare to
unity matrix */
maxd = 0; /* maximum of difference */
for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
/* compute element (i,j) of product */
{
/*1*/ sum = 0;
/*2*/ soll = ((i == j) ? 1 : 0); /* this should be the result */
for (k = 0; k < SIZE; k++)
sum += a[i * SIZE + k] * ainv[k * SIZE + j];
diff = fabs (sum - soll); /* measure difference */
if (diff > maxd) /* record maximum difference */
maxd = diff;
}
printf ("maxd=%g \n", maxd);
return 0;
}
Program should print '0' but prints 'NaN' instead.
=====================================================================
Gerhard Heinzel E-mail: ghh@mpq.mpg.de
Max-Planck-Institut fuer Quantenoptik Phone: +49(89)32905-268/252
Hans-Kopfermann-Str. 1 Phone (30m Lab): +49(89)3299-3282
D-85748 Garching Fax: +49(89)32905-200
Germany http://130.183.90.63
=====================================================================