This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Serious bug
- To: egcs-bugs at cygnus dot com, egcs at cygnus dot com
- Subject: Serious bug
- From: Ryszard Kabatek <rysio at rumcajs dot chemie dot uni-halle dot de>
- Date: Thu, 24 Sep 1998 11:37:24 +0200 (CEST)
- Reply-To: kabatek at chemie dot uni-halle dot de
There is a serious bug either in the compiler or in the library.
The source below must produce the folowing output:
1
0
1
On Linux (gcc-2.8.1 and egcs-1.1) I get:
0
5.11396e-15
1
On AIX (gcc-2.7.2) the output is correct:
1
0
1
// main.cc
# include <iostream.h>
class X {
public:
X(double x, double y) : fx(x), fy(y) {}
double func() {return fx + fy;}
private:
double fx;
double fy;
};
int main()
{
X x(100.1, 0.01);
double x1 = x.func();
double x2 = x.func();
cout << (x1 == x.func()) << '\n';
cout << (x1 - x.func()) << '\n';
cout << (x1 == x2) << '\n';
}
Ryszard Kabatek
---
Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129