[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2006-01-05 Thread rearnsha at gcc dot gnu dot org


--- Comment #21 from rearnsha at gcc dot gnu dot org  2006-01-05 15:06 
---
Subject: Bug 24998

Author: rearnsha
Date: Thu Jan  5 15:06:09 2006
New Revision: 109380

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109380
Log:
PR middle-end/24998
* arm/t-netbsd (LIB2FUNCS_EXTRA): Define.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/t-netbsd


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998




[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-12-21 Thread jsm28 at gcc dot gnu dot org


--- Comment #20 from jsm28 at gcc dot gnu dot org  2005-12-21 17:48 ---
Subject: Bug 24998

Author: jsm28
Date: Wed Dec 21 17:48:07 2005
New Revision: 108918

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108918
Log:
PR middle-end/24998
* config/arm/t-arm-elf (LIB1ASMFUNCS): Add _floatundidf and
_floatundisf.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/t-arm-elf


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-12-21 Thread paul at codesourcery dot com


--- Comment #19 from pbrook at gcc dot gnu dot org  2005-12-21 17:43 ---
Subject: Re:  Patch for arm-none-linux-gnueabi build failure

> 2005-12-21  Joseph S. Myers  <[EMAIL PROTECTED]>
>
>   PR middle-end/24998
>   * config/arm/t-arm-elf (LIB1ASMFUNCS): Add _floatundidf and
>   _floatundisf.

Ok.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-12-21 Thread joseph at codesourcery dot com


--- Comment #18 from joseph at codesourcery dot com  2005-12-21 17:39 
---
Subject:  Patch for arm-none-linux-gnueabi build failure

This patch fixes another piece of bug 24998, fallout from adding
__floatun*.  Unlike the problems with missing functions, this is one
with duplicate functions: builds for arm-none-linux-gnueabi fail
because __floatundisf and __floatundidf are multiply defined, once in
libgcc2.c and once in ieee754-[ds]f.S.  Where a target defines its own
version of a function in libgcc2.c, it needs to be listed in
LIB1ASMFUNCS to avoid the libgcc2.c version being compiled.  (In this
case, a group of functions are all included in the same object file so
inclusion in LIB1ASMFUNCS wasn't needed for the ARM version to get
compiled in the first place.)

Tested with cross-compiler to arm-none-linux-gnueabi; it fixes the
build of the compiler.  OK to commit?

2005-12-21  Joseph S. Myers  <[EMAIL PROTECTED]>

PR middle-end/24998
* config/arm/t-arm-elf (LIB1ASMFUNCS): Add _floatundidf and
_floatundisf.

diff -rupN GCC.orig/gcc/config/arm/t-arm-elf GCC/gcc/config/arm/t-arm-elf
--- GCC.orig/gcc/config/arm/t-arm-elf   2005-10-28 23:33:56.0 +
+++ GCC/gcc/config/arm/t-arm-elf2005-12-21 16:40:19.0 +
@@ -4,7 +4,7 @@ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3
_lshrdi3 _ashrdi3 _ashldi3 \
_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
-   _fixsfsi _fixunssfsi _floatdidf _floatdisf
+   _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf

 MULTILIB_OPTIONS = marm/mthumb
 MULTILIB_DIRNAMES= arm thumb


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-28 Thread joseph at codesourcery dot com


--- Comment #17 from joseph at codesourcery dot com  2005-11-28 23:43 
---
Subject: Re:  [4.2 Regression] Build failure on
 sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

Current status:

PA needs fixing, probably similarly to ia64-hpux.

So does MIPS16.

FRV may need fixing, probably by the FRV maintainers.

m68k needs the functions added to config/m68k/fpgnulib.c (bug 25138).

There may be breakage in the US_SOFTWARE_GOFAST case (config/gofast.h), 
though I suspect this is unused.

arm-netbsdelf needs fixing; if the config/floatunsi{sf,df}.c files I added 
prove inadequate for that then I'll look at fixing whatever's wrong with 
them.  Likewise, any other platform getting __floatsi* from libc needs 
fixing in a similar way: use those files to call the signed libcall.

There may be a glibc bug in sysdeps/powerpc/soft-fp/q_utoq.c defining 
_q_uitoq which is the wrong name.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-26 Thread mark at codesourcery dot com


--- Comment #16 from mark at codesourcery dot com  2005-11-26 21:48 ---
Subject: Re:  Patch for ia64-hpux problems

Joseph S. Myers wrote:
> This patch fixes the ia64-hpux problems with my __floatun* patch.  It adds 
> a full set of C implementations of __floatunsi* which should also be 
> usable to solve the arm-netbsdelf problems.
> 
> Bootstrapped with no regressions on ia64-hp-hpux11.23.  OK to commit?

OK, thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-25 Thread joseph at codesourcery dot com


--- Comment #15 from joseph at codesourcery dot com  2005-11-26 03:55 
---
Subject:  Patch for ia64-hpux problems

This patch fixes the ia64-hpux problems with my __floatun* patch.  It adds 
a full set of C implementations of __floatunsi* which should also be 
usable to solve the arm-netbsdelf problems.

Bootstrapped with no regressions on ia64-hp-hpux11.23.  OK to commit?

2005-11-26  Joseph S. Myers  <[EMAIL PROTECTED]>

* config/floatunsisf.c, config/floatunsidf.c,
config/floatunsixf.c, config/floatunsitf.c: New files.
* config/ia64/t-hpux: Add floatunsitf.c.
* config/ia64/ia64.c (ia64_init_libfuncs): Use
_U_Qfcnvxuf_dbl_to_quad for unsigned DImode-to-TFmode conversion.

diff -rupN GCC.orig/gcc/config/floatunsidf.c GCC/gcc/config/floatunsidf.c
--- GCC.orig/gcc/config/floatunsidf.c   1970-01-01 00:00:00.0 +
+++ GCC/gcc/config/floatunsidf.c2005-11-25 15:21:38.0 +
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float DFtype __attribute__ ((mode (DF)));
+
+DFtype
+__floatunsidf (USItype u)
+{
+  SItype s = (SItype) u;
+  DFtype r = (DFtype) s;
+  if (s < 0)
+r += (DFtype)2.0 * (DFtype) ((USItype) 1
+<< (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/floatunsisf.c GCC/gcc/config/floatunsisf.c
--- GCC.orig/gcc/config/floatunsisf.c   1970-01-01 00:00:00.0 +
+++ GCC/gcc/config/floatunsisf.c2005-11-25 15:26:54.0 +
@@ -0,0 +1,18 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float SFtype __attribute__ ((mode (SF)));
+
+SFtype
+__floatunsisf (USItype u)
+{
+  SItype s = (SItype) u;
+  if (s < 0)
+{
+  /* As in expand_float, compute (u & 1) | (u >> 1) to ensure
+correct rounding if a nonzero bit is shifted out.  */
+  return (SFtype) 2.0 * (SFtype) (SItype) ((u & 1) | (u >> 1));
+}
+  else
+return (SFtype) s;
+}
diff -rupN GCC.orig/gcc/config/floatunsitf.c GCC/gcc/config/floatunsitf.c
--- GCC.orig/gcc/config/floatunsitf.c   1970-01-01 00:00:00.0 +
+++ GCC/gcc/config/floatunsitf.c2005-11-25 15:21:48.0 +
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float TFtype __attribute__ ((mode (TF)));
+
+TFtype
+__floatunsitf (USItype u)
+{
+  SItype s = (SItype) u;
+  TFtype r = (TFtype) s;
+  if (s < 0)
+r += (TFtype)2.0 * (TFtype) ((USItype) 1
+<< (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/floatunsixf.c GCC/gcc/config/floatunsixf.c
--- GCC.orig/gcc/config/floatunsixf.c   1970-01-01 00:00:00.0 +
+++ GCC/gcc/config/floatunsixf.c2005-11-25 15:21:43.0 +
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float XFtype __attribute__ ((mode (XF)));
+
+XFtype
+__floatunsixf (USItype u)
+{
+  SItype s = (SItype) u;
+  XFtype r = (XFtype) s;
+  if (s < 0)
+r += (XFtype)2.0 * (XFtype) ((USItype) 1
+<< (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/ia64/ia64.c GCC/gcc/config/ia64/ia64.c
--- GCC.orig/gcc/config/ia64/ia64.c 2005-11-20 16:20:24.0 +
+++ GCC/gcc/config/ia64/ia64.c  2005-11-25 15:10:32.0 +
@@ -8437,6 +8437,9 @@ ia64_init_libfuncs (void)

   set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
   set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
+  /* HP-UX 11.23 libc does not have a function for unsigned
+ SImode-to-TFmode conversion.  */
+  set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxuf_dbl_to_quad");
 }

 /* Rename all the TFmode libfuncs using the HPUX conventions.  */
diff -rupN GCC.orig/gcc/config/ia64/t-hpux GCC/gcc/config/ia64/t-hpux
--- GCC.orig/gcc/config/ia64/t-hpux 2005-10-28 23:33:38.0 +
+++ GCC/gcc/config/ia64/t-hpux  2005-11-25 15:38:27.0 +
@@ -9,7 +9,7 @@ MULTILIB_MATCHES =

 # Support routines for HP-UX 128 bit floats.

-LIB2FUNCS_EXTRA=quadlib.c
+LIB2FUNCS_EXTRA=quadlib.c $(srcdir)/config/floatunsitf.c

 quadlib.c: $(srcdir)/config/ia64/quadlib.c
cat $(srcdir)/config/ia64/quadlib.c > quadlib.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-25 Thread andreast at gcc dot gnu dot org


--- Comment #14 from andreast at gcc dot gnu dot org  2005-11-25 14:36 
---
results with patch-part applied for sparc:
http://gcc.gnu.org/ml/gcc-testresults/2005-11/msg01172.html

Thanks!!!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-25 Thread jsm28 at gcc dot gnu dot org


--- Comment #13 from jsm28 at gcc dot gnu dot org  2005-11-25 12:57 ---
Subject: Bug 24998

Author: jsm28
Date: Fri Nov 25 12:57:02 2005
New Revision: 107502

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107502
Log:
PR middle-end/24998
* config/sparc/sparc.c (sparc_init_libfuncs): Use _Q_utoq and
_Q_ulltoq for unsigned conversions from SImode and DImode to
TFmode.

testsuite:
* gcc.dg/torture/fp-int-convert-float.c,
gcc.dg/torture/fp-int-convert-double.c,
gcc.dg/torture/fp-int-convert-long-double.c,
gcc.dg/torture/fp-int-convert-timode.c,
gcc.dg/torture/fp-int-convert-float80.c,
gcc.dg/torture/fp-int-convert-float80-timode.c,
gcc.dg/torture/fp-int-convert-float128.c,
gcc.dg/torture/fp-int-convert-float128-timode.c,
gcc.dg/torture/fp-int-convert.h: New files.


Added:
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
  - copied unchanged from r107481,
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sparc/sparc.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-25 Thread rearnsha at gcc dot gnu dot org


--- Comment #12 from rearnsha at gcc dot gnu dot org  2005-11-25 10:09 
---
Subject: Re:  [4.2 Regression] Build failure on
sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

On Fri, 2005-11-25 at 02:51, joseph at codesourcery dot com wrote:
>   It
> does not address the arm-netbsdelf problem (__floatsidf in libc),
> which really needs to be addressed by someone who can test that
> platform

No, it needs to be addressed by someone who understands and can write
ieee floating point support code.  I can help testing, but I cannot just
write code of that subtlety.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-24 Thread jsm28 at gcc dot gnu dot org


--- Comment #11 from jsm28 at gcc dot gnu dot org  2005-11-25 03:57 ---
Subject: Bug 24998

Author: jsm28
Date: Fri Nov 25 03:57:22 2005
New Revision: 107483

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107483
Log:
PR middle-end/24998
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Use _q_utoq for
unsigned conversions from SImode to TFmode.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-24 Thread jsm28 at gcc dot gnu dot org


--- Comment #10 from jsm28 at gcc dot gnu dot org  2005-11-25 03:53 ---
Subject: Bug 24998

Author: jsm28
Date: Fri Nov 25 03:53:30 2005
New Revision: 107481

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107481
Log:
PR middle-end/24998
* gcc/config/rs6000/rs6000.c (rs6000_init_libfuncs): Use _q_utoq
for unsigned conversions from SImode to TFmode.
* gcc/config/sparc/sparc.c (sparc_init_libfuncs): Use _Q_utoq and
_Q_ulltoq for unsigned conversions from SImode and DImode to
TFmode.
* gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c,
gcc/testsuite/gcc.dg/torture/fp-int-convert.h: New files.

Added:
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
   
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
branches/csl-ppc4xx-branch/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
Modified:
branches/csl-ppc4xx-branch/ChangeLog.csl
branches/csl-ppc4xx-branch/gcc/config/rs6000/rs6000.c
branches/csl-ppc4xx-branch/gcc/config/sparc/sparc.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-24 Thread joseph at codesourcery dot com


--- Comment #9 from joseph at codesourcery dot com  2005-11-25 02:51 ---
Subject:  Patch for sparc-solaris build failure

This patch fixes some of the problems associated with the use of
libcalls for unsigned-to-floating conversions (bug 24998).  The
underlying problem was that my patch did not allow for targets which
defined their own libcall names, referring to functions in libc.

It does not address the powerpc64-linux problem (where
config/rs6000/ppc64-fp.c needs unsigned functions added); I understand
from IRC that someone has an unsubmitted patch for that already.  It
does not address the arm-netbsdelf problem (__floatsidf in libc),
which really needs to be addressed by someone who can test that
platform; likewise any other platform with the GNU names in libc.

Of the platforms using libcalls to libc, it fixes the issue for SPARC
(_Q_utoq specified in the ABI, _Q_ulltoq from the Solaris libc) and
PowerPC (_q_utoq in the ABI; for some reason glibc's
sysdeps/powerpc/soft-fp/q_utoq.c defines _q_uitoq but this looks like
a bug given the ABI and given that the Versions file says _q_utoq).
It doesn't fix the issue for ia64-hpux, which I intend to address in a
followup patch (the HP-UX libc has _U_Qfcnvxuf_dbl_to_quad for
unsigned DImode to TFmode conversion, but nothing for unsigned SImode
to TFmode conversion so I'll add a C wrapper).  I can't test hppa-hpux
right now though the issues are probably similar.  In the cases of
MIPS and FRV I hope the relevant maintainers can help.  The MIPS issue
seems only to be with mips16.S which needs implementations of the
relevant functions.  The FRV issue is that there are trivial C
implementations of the form

double __uitod (unsigned int a)
{
  return a;
}

but unlike for the signed functions there is nothing to make the
compiler call those names; if the intention was for these functions to
use the wrapper around a signed libcall the compiler formerly
generated, the right approach (given that this seems to be a
soft-float target) might be to remove these trivial implementations
and instead treat them just like the signed functions.

The tests are much bigger than the rest of the patch, and I hope for
the most part more thorough than gcc.c-torture/execute/conversion.c
which tests similar things (and gets largely optimized away at higher
optimization levels).

If one of the included testcases fails on your platform because of
undefined references to __floatun*, and it does not have a
corresponding undefined reference to the corresponding signed
conversion function without "un" in the name, add a note to bug 24998.
If it fails for any other reason indicating a bug in GCC, open an
appropriate new bug if there isn't one already (I filed bug 25028 for
a problem with TImode conversions being broken, shown up by the
testcases).  Some tests may fail because of external issues: the
__float128 tests are XFAILed on x86/x86_64 because they need an
external library implementing the TFmode functions (but when the fixes
are complete they should work OK on ia64-hpux which has enough
functions in libc).

I've verified that this patch makes a sparc-sun-solaris2.8 build go
beyond where it previously failed, and tested the new testcases for
syntax and XFAILs on x86_64-unknown-linux-gnu.  OK to commit?

2005-11-25  Joseph S. Myers  <[EMAIL PROTECTED]>

PR middle-end/24998
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Use _q_utoq for
unsigned conversions from SImode to TFmode.
* config/sparc/sparc.c (sparc_init_libfuncs): Use _Q_utoq and
_Q_ulltoq for unsigned conversions from SImode and DImode to
TFmode.

testsuite:
2005-11-25  Joseph S. Myers  <[EMAIL PROTECTED]>

PR middle-end/24998
* gcc.dg/torture/fp-int-convert-float.c,
gcc.dg/torture/fp-int-convert-double.c,
gcc.dg/torture/fp-int-convert-long-double.c,
gcc.dg/torture/fp-int-convert-timode.c,
gcc.dg/torture/fp-int-convert-float80.c,
gcc.dg/torture/fp-int-convert-float80-timode.c,
gcc.dg/torture/fp-int-convert-float128.c,
gcc.dg/torture/fp-int-convert-float128-timode.c,
gcc.dg/torture/fp-int-convert.h: New files.

diff -rupN GCC.orig/gcc/config/rs6000/rs6000.c GCC/gcc/config/rs6000/rs6000.c
--- GCC.orig/gcc/config/rs6000/rs6000.c 2005-11-23 14:11:11.0 +
+++ GCC/gcc/config/rs6000/rs6000.c  2005-11-24 23:34:31.0 +
@@ -9078,6 +9078,7 @@ rs6000_init_libfuncs (void)
   set_conv_libfunc (sfix_optab, SImode, TFmode, "_q_qtoi");
   set_conv_libfunc (ufix_optab, SImode, TFmode, "_q_qtou");
   set_conv_libfunc (sfloat_optab, TFmode, SImode, "_q_itoq");
+  set_conv_libfunc (ufloat_optab, TFmode, SImode, "_q_utoq");
 }
 }

diff -rupN GCC.orig/gcc/config/sparc/sparc.c GCC/gcc/config/sparc/sparc.c
--- GCC.orig/gcc/config/sparc/sparc.c   2005-10-28 23:33:40.0 +
+++ GCC/gcc/config/sparc/sparc.c2005-11-24 23:40:27.0 +
@@ -7707,12 +77

[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread joseph at codesourcery dot com


--- Comment #8 from joseph at codesourcery dot com  2005-11-23 14:54 ---
Subject: Re:  [4.2 Regression] Build failure on
 sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

On Wed, 23 Nov 2005, rearnsha at gcc dot gnu dot org wrote:

> Not that simple, because the implementation of __floatunsidf is tightly
> integrated with the implementation of __adddf3.  And we don't want to
> override that because the ieee754-df.S implementation does not support
> raising signals.

In that case there's the possibility of a trivial C implementation along 
the lines of

double __floatunsidf (unsigned i)
{
  double r = (double)(int)i;
  if ((int)i < 0)
r += 0x1p32f;
  return r;
}

(with a bit more complexity for correct rounding in the "float" case, as 
expand_float does).  Adding such implementations to libgcc2.c is the 
simplest workaround for this bug, but I'd hope that most issues can be 
resolved separately so such implementations are only needed in the case of 
__float* in libc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread rearnsha at gcc dot gnu dot org


--- Comment #7 from rearnsha at gcc dot gnu dot org  2005-11-23 14:44 
---
Subject: Re:  [4.2 Regression] Build failure on
sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

On Wed, 2005-11-23 at 14:28, joseph at codesourcery dot com wrote:

> In that case the obvious solution is for the NetBSD configuration to start 
> using that one function from ieee754-df.S.  (I checked that the 
> implementations in GCC of __float* already had corresponding 
> implementations of __floatun* as required - missing rs6000/ppc64-fp.c in 
> the process - but couldn't check for any case where these functions came 
> from libc.)

Not that simple, because the implementation of __floatunsidf is tightly
integrated with the implementation of __adddf3.  And we don't want to
override that because the ieee754-df.S implementation does not support
raising signals.

R.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



Re: [Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread Richard Earnshaw
On Wed, 2005-11-23 at 14:28, joseph at codesourcery dot com wrote:

> In that case the obvious solution is for the NetBSD configuration to start 
> using that one function from ieee754-df.S.  (I checked that the 
> implementations in GCC of __float* already had corresponding 
> implementations of __floatun* as required - missing rs6000/ppc64-fp.c in 
> the process - but couldn't check for any case where these functions came 
> from libc.)

Not that simple, because the implementation of __floatunsidf is tightly
integrated with the implementation of __adddf3.  And we don't want to
override that because the ieee754-df.S implementation does not support
raising signals.

R.


[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread joseph at codesourcery dot com


--- Comment #6 from joseph at codesourcery dot com  2005-11-23 14:28 ---
Subject: Re:  [4.2 Regression] Build failure on
 sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

On Wed, 23 Nov 2005, rearnsha at gcc dot gnu dot org wrote:

> > ARM should be getting __floatunsidf from ieee754-df.S.  Why isn't it?  
> > Did the code previously use __floatsidf, and if so where did it get 
> > __floatsidf from?
> 
> Because this is NetBSD, which doesn't use ieee754-df.S.  And the C
> library only provides __floatsidf.

In that case the obvious solution is for the NetBSD configuration to start 
using that one function from ieee754-df.S.  (I checked that the 
implementations in GCC of __float* already had corresponding 
implementations of __floatun* as required - missing rs6000/ppc64-fp.c in 
the process - but couldn't check for any case where these functions came 
from libc.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread rearnsha at gcc dot gnu dot org


--- Comment #5 from rearnsha at gcc dot gnu dot org  2005-11-23 14:22 
---
Subject: Re:  [4.2 Regression] Build failure on
sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

On Wed, 2005-11-23 at 14:09, joseph at codesourcery dot com wrote:
> On Wed, 23 Nov 2005, rearnsha at gcc dot gnu dot org wrote:
> 
> > /work/rearnsha/gnusrc/gcc/trunk/gcc/timevar.c:203: undefined reference to
> > `__floatunsidf'
> 
> ARM should be getting __floatunsidf from ieee754-df.S.  Why isn't it?  
> Did the code previously use __floatsidf, and if so where did it get 
> __floatsidf from?

Because this is NetBSD, which doesn't use ieee754-df.S.  And the C
library only provides __floatsidf.

Sorry, I hadn't realized this was restricted only to arm-netbsdelf


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread joseph at codesourcery dot com


--- Comment #4 from joseph at codesourcery dot com  2005-11-23 14:09 ---
Subject: Re:  Build failure on sparc-sun-solaris2.9/arm:
 undefined symbol __floatunsitf

On Wed, 23 Nov 2005, rearnsha at gcc dot gnu dot org wrote:

> /work/rearnsha/gnusrc/gcc/trunk/gcc/timevar.c:203: undefined reference to
> `__floatunsidf'

ARM should be getting __floatunsidf from ieee754-df.S.  Why isn't it?  
Did the code previously use __floatsidf, and if so where did it get 
__floatsidf from?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread joseph at codesourcery dot com


--- Comment #3 from joseph at codesourcery dot com  2005-11-23 14:07 ---
Subject: Re:   New: Build failure on sparc-sun-solaris2.9:
 undefined symbol __floatunsitf

On Wed, 23 Nov 2005, fxcoudert at gcc dot gnu dot org wrote:

> Undefined   first referenced
>  symbol in file
> __floatunsitf   libgcc/./_floatditf_s.o

What did the assembly code look like before and after my patch?  If it 
previously used __floatsitf, where did it get the definition of that 
symbol?  If not, I suspect a bug in the optabs.c changes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998



[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf

2005-11-23 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|critical|blocker
  Component|bootstrap   |middle-end
   Keywords||link-failure
Summary|Build failure on sparc-sun- |[4.2 Regression] Build
   |solaris2.9/arm: undefined   |failure on sparc-sun-
   |symbol __floatunsitf|solaris2.9/arm: undefined
   ||symbol __floatunsitf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998