diff options
author | Richard Guenther <rguenther@suse.de> | 2009-03-10 15:42:51 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2009-03-10 15:42:51 +0000 |
commit | ddef83d233115de4468ed16c496015faaf838c72 (patch) | |
tree | b112387fb1d9c7588e52c54ff684c5e6c389a78b /gcc/libgcc2.c | |
parent | bb947fd1d9e5710bb8539bfda06c1ba14c6d4447 (diff) | |
download | gcc-ddef83d233115de4468ed16c496015faaf838c72.zip gcc-ddef83d233115de4468ed16c496015faaf838c72.tar.gz gcc-ddef83d233115de4468ed16c496015faaf838c72.tar.bz2 |
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
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 08f1ee6..0966ac2 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -1831,6 +1831,7 @@ CTYPE CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) { MTYPE ac, bd, ad, bc, x, y; + CTYPE res; ac = a * c; bd = b * 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 */ @@ -1898,6 +1901,7 @@ CTYPE CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) { MTYPE denom, ratio, x, y; + CTYPE res; /* ??? We can get better behavior from logarithmic scaling instead of 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) } } - return x + I * y; + __real__ res = x; + __imag__ res = y; + return res; } #endif /* complex divide */ |