[C/C++] obscure ICEs with __complex__ on Solaris

Gabriel Dos_Reis Gabriel.Dos_Reis@sophia.inria.fr
Tue Jul 27 13:51:00 GMT 1999


Well, these took me two days to track :-(

While cleaning libstdc++-v3/bits/std_complex.h, I found the following
craches the compiler (current CVS):

poivre% cat /tmp/1.C 

struct gnu_double_complex {
    __complex__ double v;

    gnu_double_complex(double, double);
};

gnu_double_complex::gnu_double_complex(double r, double i)
{
    __real__ v = r;
    __imag__ v = i;
}

int main()
{
    gnu_double_complex z(9, 7);

    gnu_double_complex w = z;
}

poivre% ~/EGCS/bin/g++ -O 1.C  
1.C: In function `int main()':
1.C:16: Internal compiler error.
1.C:16: Please submit a full bug report.
1.C:16: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for instructions.

[ Lovely message; isn't it? ;-) ]

But it does *compile* fine, without optimization.

Next I tried:

poivre% cat 2.c
struct X {
    __complex__ double v;
};

int main()
{
    __complex__ double z;
    struct X x;
   x.v = z;
}
poivre% ~/EGCS/bin/gcc -O 2.c 
2.c: In function `main':
2.c:9: Internal compiler error in `change_address', at emit-rtl.c:1580
Please submit a full bug report.
See <URL: http://egcs.cygnus.com/faq.html#bugreport > for instructions.


Seems like a problem common to the two front-ends.

-- Gaby






More information about the Gcc-patches mailing list