A new alpha bug

H.J. Lu hjl@lucon.org
Sun Sep 14 11:40:00 GMT 1997


> > complex_double one = 1.0;
> 
> complex_double tmp (1.0, 0);
> complex_double one (tmp);
> 

Well, it looks like a g++ and alpha/TImode bug. The default copy
constructor on alpha generated by g++ is bogus when TImode is used.
If a copy constructor is defined, the code compils/runs fine.

# gcc -O foo.cc
# a.out


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)
----
class complex_double
{
public:
  complex_double (double r = 0, double i = 0): re (r), im (i) { }
  complex_double (const complex_double &x)
  {
    re = x.re;
    im = x.im;
  }

  double re, im;
};

main()
{
  complex_double one = 1.0;
  if (one.re != 1.0 || one.im != 0.0)
    abort ();

  return 0;
}



More information about the Gcc mailing list