diff options
author | H.J. Lu <hjl@gcc.gnu.org> | 2019-01-23 13:41:59 -0800 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2019-01-23 13:41:59 -0800 |
commit | 6395ba73f84930d5ebcf692a3bd570da600f9da9 (patch) | |
tree | 3e2db0c016b1c095fc8dab9c2987a3bc4ddf68ce /libgcc/libgcc2.c | |
parent | 8c5b33788da402bdc1e3a14288e2dd8c8bd709e9 (diff) | |
download | gcc-6395ba73f84930d5ebcf692a3bd570da600f9da9.tar.gz |
libgcc2.c: Correct DI/TI -> SF/DF conversions
FSTYPE FUNC (DWtype u) in libgcc2.c, which converts DI/TI to SF/DF, has
/* No leading bits means u == minimum. */
if (count == 0)
return -(Wtype_MAXp1_F * (Wtype_MAXp1_F / 2));
in the third case (where actually count == 0 only means the high part is
minimum). It should be:
/* No leading bits means u == minimum. */
if (count == 0)
return Wtype_MAXp1_F * (FSTYPE) (hi | ((UWtype) u != 0));
instead.
gcc/testsuite/
2019-01-23 H.J. Lu <hongjiu.lu@intel.com>
PR libgcc/88931
* gcc.dg/torture/fp-int-convert-timode-1.c: New test.
* gcc.dg/torture/fp-int-convert-timode-2.c: Likewise.
* gcc.dg/torture/fp-int-convert-timode-3.c: Likewise.
* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
libgcc/
2019-01-23 Joseph Myers <joseph@codesourcery.com>
PR libgcc/88931
* libgcc2.c (FSTYPE FUNC (DWtype u)): Correct no leading bits
case.
From-SVN: r268216
Diffstat (limited to 'libgcc/libgcc2.c')
-rw-r--r-- | libgcc/libgcc2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index d84f25b0779..04d3185e805 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1684,7 +1684,7 @@ FUNC (DWtype u) /* No leading bits means u == minimum. */ if (count == 0) - return -(Wtype_MAXp1_F * (Wtype_MAXp1_F / 2)); + return Wtype_MAXp1_F * (FSTYPE) (hi | ((UWtype) u != 0)); shift = 1 + W_TYPE_SIZE - count; |