Patch for COMPLEX support
Weiwen Liu
weiwen.liu@yale.edu
Wed Jan 7 16:09:00 GMT 1998
I am sending a patch to fix the support for complex arguments. I have
tested this patch on alphaev56-dec-osf4.0 and sparc-sun-solaris2. On
alpha, this patch introduces no regression from 'make check-gcc' and
'make check-g++'.
I have separated the patch into two parts which are contained in
separate emails.
I would appreciate if this patch can be tested on other platforms.
The test case I use is:
#ifndef F
#define F int
#endif
typedef __complex__ F FC;
FC f1(int odd, FC a, FC b, FC c, FC d)
{
return a + b + c + d;
}
FC f2a(F a, F b, F c, F d, F e, F f, F g, F h)
{
return (a + c + e + g) + 1i * (b + d + f + h);
}
FC f2b(FC a, FC b, FC c, FC d)
{
return a + b + c + d;
}
int main()
{
FC a, b, c, d, e;
a = -1 + 2i;
b = -3+4i;
c = -5+6i;
d = -7+8i;
e=f2b(a,b,c,d);
if (e != -16+20i)
abort ();
e=f2a(-1,2,-3,4,-5,6,-7,8);
if (e != -16+20i)
abort ();
e = f1(1,a,b,c,d);
if (e != -16+20i)
abort ();
return 0;
}
I have tested with F=(char, short, int, long, float, double) and with
no-optimization, -O1, -O2, -O3.
More information about the Gcc
mailing list