optabs.c (expand_float): Don't allow mode widening that causes double rounding.
authorGeoff Keating <geoffk@cygnus.com>
Sun, 14 May 2000 21:18:13 +0000 (21:18 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sun, 14 May 2000 21:18:13 +0000 (21:18 +0000)
* optabs.c (expand_float): Don't allow mode widening that causes
double rounding.

From-SVN: r33894

gcc/ChangeLog
gcc/optabs.c

index 15e3633814f00c9feb1de7dbb0828779acfeb4cd..169ee51a584707ac24154bbe58b170289c39cc6d 100644 (file)
@@ -1,4 +1,7 @@
-2000-05-13  Geoffrey Keating  <geoffk@cygnus.com>
+2000-05-14  Geoffrey Keating  <geoffk@cygnus.com>
+
+       * optabs.c (expand_float): Don't allow mode widening that causes
+       double rounding.
 
        * invoke.texi (RS/6000 and PowerPC Options): Update -m64/-m32
        flags to their current names -maix64 and -maix32.
index 0cfe0649d6fc86938faa95878e809f0f054f7ce0..9f9871581aa6fcdf2acd41d9ac8c50ba98bb64a8 100644 (file)
@@ -3888,6 +3888,10 @@ expand_float (to, from, unsignedp)
       {
        int doing_unsigned = unsignedp;
 
+       if (fmode != GET_MODE (to)
+           && significand_size (fmode) < GET_MODE_BITSIZE (GET_MODE (from)))
+         continue;
+
        icode = can_float_p (fmode, imode, unsignedp);
        if (icode == CODE_FOR_nothing && imode != GET_MODE (from) && unsignedp)
          icode = can_float_p (fmode, imode, 0), doing_unsigned = 0;