Commit ddef83d2 by Richard Guenther Committed by Nathan Froyd

re PR middle-end/37850 (infinite recursive call to __mulsc3 when multiplying not-constant complexs)

	PR middle-end/37850
	* libgcc2.c (__mulMODE3): Use explicit assignments to form the
	result.
	(__divMODE3): Likewise.

Co-Authored-By: Nathan Froyd <froydnj@codesourcery.com>

From-SVN: r144751
parent bb947fd1
2009-03-10 Richard Guenther <rguenther@suse.de>
Nathan Froyd <froydnj@codesourcery.com>
PR middle-end/37850
* libgcc2.c (__mulMODE3): Use explicit assignments to form the
result.
(__divMODE3): Likewise.
2009-03-09 Jakub Jelinek <jakub@redhat.com> 2009-03-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/39394 PR tree-optimization/39394
......
...@@ -1831,6 +1831,7 @@ CTYPE ...@@ -1831,6 +1831,7 @@ CTYPE
CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
{ {
MTYPE ac, bd, ad, bc, x, y; MTYPE ac, bd, ad, bc, x, y;
CTYPE res;
ac = a * c; ac = a * c;
bd = b * d; bd = b * d;
...@@ -1887,7 +1888,9 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) ...@@ -1887,7 +1888,9 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
} }
} }
return x + I * y; __real__ res = x;
__imag__ res = y;
return res;
} }
#endif /* complex multiply */ #endif /* complex multiply */
...@@ -1898,6 +1901,7 @@ CTYPE ...@@ -1898,6 +1901,7 @@ CTYPE
CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
{ {
MTYPE denom, ratio, x, y; MTYPE denom, ratio, x, y;
CTYPE res;
/* ??? We can get better behavior from logarithmic scaling instead of /* ??? We can get better behavior from logarithmic scaling instead of
the division. But that would mean starting to link libgcc against the division. But that would mean starting to link libgcc against
...@@ -1943,7 +1947,9 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) ...@@ -1943,7 +1947,9 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
} }
} }
return x + I * y; __real__ res = x;
__imag__ res = y;
return res;
} }
#endif /* complex divide */ #endif /* complex divide */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment