From: Richard Guenther Date: Tue, 10 Mar 2009 15:42:51 +0000 (+0000) Subject: re PR middle-end/37850 (infinite recursive call to __mulsc3 when multiplying not... X-Git-Tag: releases/gcc-4.4.0~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddef83d233115de4468ed16c496015faaf838c72;p=thirdparty%2Fgcc.git 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 From-SVN: r144751 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 341bcc6155b7..7325c220e12f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-03-10 Richard Guenther + Nathan Froyd + + PR middle-end/37850 + * libgcc2.c (__mulMODE3): Use explicit assignments to form the + result. + (__divMODE3): Likewise. + 2009-03-09 Jakub Jelinek PR tree-optimization/39394 diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 08f1ee69732a..0966ac216c23 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 */