Bug 24998

Summary: [4.9/5/6 Regression] Build failure: undefined symbol __floatunsitf
Product: gcc Reporter: Francois-Xavier Coudert <fxcoudert>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: aoliva, echristo, gcc-bugs, jeffreyalaw, jsm28, mmokrejs, rsandifo
Priority: P5 Keywords: build, link-failure
Version: 4.2.0   
Target Milestone: 4.9.4   
Host: Target: frv-*-*
Build: Known to work:
Known to fail: Last reconfirmed: 2005-11-23 09:00:05

Description Francois-Xavier Coudert 2005-11-23 08:53:17 UTC
Undefined                       first referenced
 symbol                             in file
__floatunsitf                       libgcc/./_floatditf_s.o
ld: fatal: Symbol referencing errors. No output written to ./libgcc_s.so.1.tmp
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/tmp/gfortran-20051123/ibin/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/tmp/gfortran-20051123/ibin/gcc'

This is with a "../gcc/configure --enable-languages=c,fortran --disable-libssp --disable-libmudflap --disable-nls && gmake". It happened with mainline on 20051122 and 20051123, but not on 20051121 and before.
Comment 1 Andreas Tobler 2005-11-23 09:00:05 UTC
happens also on sparc-sun-solaris2.8.

This patch is responsible for:


http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107345
Comment 2 Richard Earnshaw 2005-11-23 12:12:17 UTC
Similar failures on arm:

libbackend.a(timevar.o)(.text+0x1e4): In function `get_time':
/work/rearnsha/gnusrc/gcc/trunk/gcc/timevar.c:203: undefined reference to `__floatunsidf'
libbackend.a(timevar.o)(.text+0x200):/work/rearnsha/gnusrc/gcc/trunk/gcc/timevar.c:204: undefined reference to `__floatunsidf'
libbackend.a(timevar.o)(.text+0x220):/work/rearnsha/gnusrc/gcc/trunk/gcc/timevar.c:205: undefined reference to `__floatunsidf'
Comment 3 joseph@codesourcery.com 2005-11-23 14:07:54 UTC
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.

Comment 4 joseph@codesourcery.com 2005-11-23 14:09:38 UTC
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?

Comment 5 Richard Earnshaw 2005-11-23 14:22:13 UTC
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
Comment 6 joseph@codesourcery.com 2005-11-23 14:28:59 UTC
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.)

Comment 7 Richard Earnshaw 2005-11-23 14:44:38 UTC
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.
Comment 8 joseph@codesourcery.com 2005-11-23 14:54:29 UTC
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.

Comment 9 joseph@codesourcery.com 2005-11-25 02:51:24 UTC
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  <joseph@codesourcery.com>

	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  <joseph@codesourcery.com>

	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.000000000 +0000
+++ GCC/gcc/config/rs6000/rs6000.c	2005-11-24 23:34:31.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/sparc/sparc.c	2005-11-24 23:40:27.000000000 +0000
@@ -7707,12 +7707,14 @@ sparc_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");
 
       if (DITF_CONVERSION_LIBFUNCS)
 	{
 	  set_conv_libfunc (sfix_optab,   DImode, TFmode, "_Q_qtoll");
 	  set_conv_libfunc (ufix_optab,   DImode, TFmode, "_Q_qtoull");
 	  set_conv_libfunc (sfloat_optab, TFmode, DImode, "_Q_lltoq");
+	  set_conv_libfunc (ufloat_optab, TFmode, DImode, "_Q_ulltoq");
 	}
 
       if (SUN_CONVERSION_LIBFUNCS)
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,18 @@
+/* Test floating-point conversions.  Standard types and double.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+  TEST_I_F(signed char, unsigned char, double, DBL_MANT_DIG);
+  TEST_I_F(signed short, unsigned short, double, DBL_MANT_DIG);
+  TEST_I_F(signed int, unsigned int, double, DBL_MANT_DIG);
+  TEST_I_F(signed long, unsigned long, double, DBL_MANT_DIG);
+  TEST_I_F(signed long long, unsigned long long, double, DBL_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,18 @@
+/* Test floating-point conversions.  Standard types and float.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+  TEST_I_F(signed char, unsigned char, float, FLT_MANT_DIG);
+  TEST_I_F(signed short, unsigned short, float, FLT_MANT_DIG);
+  TEST_I_F(signed int, unsigned int, float, FLT_MANT_DIG);
+  TEST_I_F(signed long, unsigned long, float, FLT_MANT_DIG);
+  TEST_I_F(signed long long, unsigned long long, float, FLT_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,18 @@
+/* Test floating-point conversions.  __float128 type with TImode.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { i?86-*-* && ilp32 } } } */
+/* { dg-options "-mmmx" { target { x86_64-*-* && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+  TEST_I_F(TItype, UTItype, __float128, FLOAT128_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,22 @@
+/* Test floating-point conversions.  __float128 type.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { i?86-*-* && ilp32 } } } */
+/* { dg-options "-mmmx" { target { x86_64-*-* && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+  TEST_I_F(signed char, unsigned char, __float128, FLOAT128_MANT_DIG);
+  TEST_I_F(signed short, unsigned short, __float128, FLOAT128_MANT_DIG);
+  TEST_I_F(signed int, unsigned int, __float128, FLOAT128_MANT_DIG);
+  TEST_I_F(signed long, unsigned long, __float128, FLOAT128_MANT_DIG);
+  TEST_I_F(signed long long, unsigned long long, __float128, FLOAT128_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,17 @@
+/* Test floating-point conversions.  __float80 type with TImode.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { i?86-*-* && ilp32 } } } */
+/* { dg-options "-mmmx" { target { x86_64-*-* && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+  TEST_I_F(TItype, UTItype, __float80, FLOAT80_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,21 @@
+/* Test floating-point conversions.  __float80 type.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { i?86-*-* && ilp32 } } } */
+/* { dg-options "-mmmx" { target { x86_64-*-* && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+  TEST_I_F(signed char, unsigned char, __float80, FLOAT80_MANT_DIG);
+  TEST_I_F(signed short, unsigned short, __float80, FLOAT80_MANT_DIG);
+  TEST_I_F(signed int, unsigned int, __float80, FLOAT80_MANT_DIG);
+  TEST_I_F(signed long, unsigned long, __float80, FLOAT80_MANT_DIG);
+  TEST_I_F(signed long long, unsigned long long, __float80, FLOAT80_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,18 @@
+/* Test floating-point conversions.  Standard types and long double.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+  TEST_I_F(signed char, unsigned char, long double, LDBL_MANT_DIG);
+  TEST_I_F(signed short, unsigned short, long double, LDBL_MANT_DIG);
+  TEST_I_F(signed int, unsigned int, long double, LDBL_MANT_DIG);
+  TEST_I_F(signed long, unsigned long, long double, LDBL_MANT_DIG);
+  TEST_I_F(signed long long, unsigned long long, long double, LDBL_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,16 @@
+/* Test floating-point conversions.  TImode types.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+  TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG);
+  TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG);
+  TEST_I_F(TItype, UTItype, long double, LDBL_MANT_DIG);
+  exit (0);
+}
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert.h GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
--- GCC.orig/gcc/testsuite/gcc.dg/torture/fp-int-convert.h	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/torture/fp-int-convert.h	2005-11-25 02:27:44.000000000 +0000
@@ -0,0 +1,89 @@
+/* Test floating-point conversions.  */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+
+#include <limits.h>
+extern void abort (void);
+extern void exit (int);
+
+/* Not all platforms support TImode integers; logic as in
+   gcc.dg/titype-1.c.  */
+#if defined(__LP64__) && !defined(__hppa__)
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+typedef unsigned long UTItype;
+#endif
+
+/* TEST_I_F(I, U, F, P) tests conversions between the pair of signed
+   and unsigned integer types I and U and the floating-point type F,
+   where P is the binary precision of the floating point type.  We
+   test conversions of the values 0, 1, 0x7...f, 0x8...0, 0xf...f.  We
+   also test conversions of values half way inbetween two
+   representable values (rounding both ways), just above half way, and
+   just below half way.  */
+#define TEST_I_F(I, U, F, P)					\
+do {								\
+  TEST_I_F_VAL (I, F, (I)0, 1);					\
+  TEST_I_F_VAL (I, F, (I)1, 1);					\
+  TEST_I_F_VAL (I, F, (I)(((U)~(U)0) >> 1), P_OK1 (P, I));	\
+  TEST_I_F_VAL (I, F, (I)(U)~(((U)~(U)0) >> 1), 1);		\
+  TEST_I_F_VAL (I, F, (I)(U)~(U)0, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL0S (P, I), P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL0S (P, I) + 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL0S (P, I) - 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL1S (P, I), P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL1S (P, I) + 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, HVAL1S (P, I) - 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL0S (P, I), P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL0S (P, I) + 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL0S (P, I) - 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL1S (P, I), P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL1S (P, I) + 1, P_OK (P, I));		\
+  TEST_I_F_VAL (I, F, -HVAL1S (P, I) - 1, P_OK (P, I));		\
+  TEST_I_F_VAL (U, F, (U)0, 1);					\
+  TEST_I_F_VAL (U, F, (U)1, 1);					\
+  TEST_I_F_VAL (U, F, (U)(((U)~(U)0) >> 1), P_OK1 (P, U));	\
+  TEST_I_F_VAL (U, F, (U)~(((U)~(U)0) >> 1), 1);		\
+  TEST_I_F_VAL (U, F, (U)~(U)0, P_OK (P, U));			\
+  TEST_I_F_VAL (U, F, HVAL0U (P, U), P_OK (P, U));		\
+  TEST_I_F_VAL (U, F, HVAL0U (P, U) + 1, P_OK (P, U));		\
+  TEST_I_F_VAL (U, F, HVAL0U (P, U) - 1, P_OK (P, U));		\
+  TEST_I_F_VAL (U, F, HVAL1U (P, U), P_OK (P, U));		\
+  TEST_I_F_VAL (U, F, HVAL1U (P, U) + 1, P_OK (P, U));		\
+  TEST_I_F_VAL (U, F, HVAL1U (P, U) - 1, P_OK (P, U));		\
+} while (0)
+
+#define P_OK(P, T) ((P) >= sizeof(T) * CHAR_BIT)
+#define P_OK1(P, T) ((P) >= sizeof(T) * CHAR_BIT - 1)
+#define HVAL0U(P, U) (U)(P_OK (P, U)					 \
+			 ? (U)1						 \
+			 : (((U)1 << (sizeof(U) * CHAR_BIT - 1))	 \
+			    + ((U)1 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL1U(P, U) (U)(P_OK (P, U)					 \
+			 ? (U)1						 \
+			 : (((U)1 << (sizeof(U) * CHAR_BIT - 1))	 \
+			    + ((U)3 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL0S(P, S) (S)(P_OK1 (P, S)					 \
+			 ? (S)1						 \
+			 : (((S)1 << (sizeof(S) * CHAR_BIT - 2))	 \
+			    + ((S)1 << (sizeof(S) * CHAR_BIT - 2 - P))))
+#define HVAL1S(P, S) (S)(P_OK1 (P, S)					 \
+			 ? (S)1						 \
+			 : (((S)1 << (sizeof(S) * CHAR_BIT - 2))	 \
+			    + ((S)3 << (sizeof(S) * CHAR_BIT - 2 - P))))
+
+#define TEST_I_F_VAL(IT, FT, VAL, PREC_OK)		\
+do {							\
+  static volatile IT ivin, ivout;			\
+  static volatile FT fv1, fv2;				\
+  ivin = (VAL);						\
+  fv1 = (VAL);						\
+  fv2 = ivin;						\
+  ivout = fv2;						\
+  if (ivin != (VAL)					\
+      || ((PREC_OK) && ivout != ivin)			\
+      || ((PREC_OK) && ivout != (VAL))			\
+      || fv1 != (VAL) || fv2 != (VAL) || fv1 != fv2)	\
+    abort ();						\
+} while (0)

Comment 10 Joseph S. Myers 2005-11-25 03:53:35 UTC
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

Comment 11 Joseph S. Myers 2005-11-25 03:57:25 UTC
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

Comment 12 Richard Earnshaw 2005-11-25 10:09:42 UTC
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.
Comment 13 Joseph S. Myers 2005-11-25 12:57:15 UTC
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

Comment 14 Andreas Tobler 2005-11-25 14:36:37 UTC
results with patch-part applied for sparc:
http://gcc.gnu.org/ml/gcc-testresults/2005-11/msg01172.html

Thanks!!!
Comment 15 joseph@codesourcery.com 2005-11-26 03:55:36 UTC
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  <joseph@codesourcery.com>

	* 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.000000000 +0000
+++ GCC/gcc/config/floatunsidf.c	2005-11-25 15:21:38.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/floatunsisf.c	2005-11-25 15:26:54.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/floatunsitf.c	2005-11-25 15:21:48.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/floatunsixf.c	2005-11-25 15:21:43.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/ia64/ia64.c	2005-11-25 15:10:32.000000000 +0000
@@ -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.000000000 +0000
+++ GCC/gcc/config/ia64/t-hpux	2005-11-25 15:38:27.000000000 +0000
@@ -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

Comment 16 Mark Mitchell 2005-11-26 21:48:30 UTC
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.

Comment 17 joseph@codesourcery.com 2005-11-28 23:43:38 UTC
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.

Comment 18 joseph@codesourcery.com 2005-12-21 17:39:18 UTC
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  <joseph@codesourcery.com>

	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.000000000 +0000
+++ GCC/gcc/config/arm/t-arm-elf	2005-12-21 16:40:19.000000000 +0000
@@ -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

Comment 19 Paul Brook 2005-12-21 17:43:57 UTC
Subject: Re:  Patch for arm-none-linux-gnueabi build failure

> 2005-12-21  Joseph S. Myers  <joseph@codesourcery.com>
>
> 	PR middle-end/24998
> 	* config/arm/t-arm-elf (LIB1ASMFUNCS): Add _floatundidf and
> 	_floatundisf.

Ok.

Paul
Comment 20 Joseph S. Myers 2005-12-21 17:48:11 UTC
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

Comment 21 Richard Earnshaw 2006-01-05 15:06:14 UTC
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

Comment 22 Andrew Pinski 2006-01-24 17:15:59 UTC
Has this all been fixed now?
Comment 23 joseph@codesourcery.com 2006-01-24 17:31:21 UTC
Subject: Re:  [4.2 Regression] Build failure: undefined
 symbol __floatunsitf

On Tue, 24 Jan 2006, pinskia at gcc dot gnu dot org wrote:

> Has this all been fixed now?

I think MIPS16, FRV and US_SOFTWARE_GOFAST still need fixing.  (The last 
quite likely by removing US_SOFTWARE_GOFAST support.)

Comment 24 dave 2006-01-24 17:39:25 UTC
Subject: Re:  [4.2 Regression] Build failure: undefined symbol __floatunsitf

> Has this all been fixed now?

This change fixes the problem on hppa*-*-hpux*:

2005-12-04  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR target/25166
	* pa/pa.c (pa_hpux_init_libfuncs): Add _U_Qfcnvxf_usgl_to_quad and
	_U_Qfcnvxf_udbl_to_quad to set of initialized libfuncs.
	* pa/quadlib.c (_U_Qfcnvxf_usgl_to_quad, _U_Qfcnvxf_udbl_to_quad): New
	functions.

Dave
Comment 25 Francois-Xavier Coudert 2006-03-08 09:55:32 UTC
(In reply to comment #23)
> I think MIPS16, FRV and US_SOFTWARE_GOFAST still need fixing.  (The last 
> quite likely by removing US_SOFTWARE_GOFAST support.)

Adding the maintainers of all those in Cc list. I don't know what US_SOFTWARE_GOFAST, but from the last sentence quoted above, it looks like I don't really want to know :)
Comment 26 Eric Christopher 2006-03-09 03:13:34 UTC
GOFAST was a library shipped for mips that I added a configure option to continue to allow to compile. I fully doubt that it's in use anywhere now so can probably be removed.
Comment 27 wilson@specifix.com 2006-03-09 22:21:04 UTC
Subject: Re:  [4.2 Regression] Build failure: undefined
 symbol __floatunsitf

fxcoudert at gcc dot gnu dot org wrote:
> Adding the maintainers of all those in Cc list. I don't know what
> US_SOFTWARE_GOFAST, but from the last sentence quoted above, it looks like I
> don't really want to know :)

I'll tell you anyways.  See
     http://www.smxinfo.com/ussw/gofast.htm

Our support code hasn't been updated in such a long time that I'm 
skeptical it works with current versions of the gofast library.
Comment 28 Mark Mitchell 2006-06-04 17:19:07 UTC
Joseph --

Would you please summarize the current state of this bug, and whether or not you intend to do any more work on it?  I'm trying to figure out how to prioritize it for 4.2.

Thanks,

-- Mark
Comment 29 joseph@codesourcery.com 2006-06-04 17:35:49 UTC
Subject: Re:  [4.2 Regression] Build failure: undefined
 symbol __floatunsitf

On Sun, 4 Jun 2006, mmitchel at gcc dot gnu dot org wrote:

> ------- Comment #28 from mmitchel at gcc dot gnu dot org  2006-06-04 17:19 -------
> Joseph --
> 
> Would you please summarize the current state of this bug, and whether or not
> you intend to do any more work on it?  I'm trying to figure out how to
> prioritize it for 4.2.

The state is still as in comment#23 and I don't intend to do any more work 
on it (though I could do the US_SOFTWARE_GOFAST removal if desired).

* MIPS16 (mips16.S needs implementations of the relevant functions, 
mips_init_libfuncs should arrange for them to be called) - preferably to 
be done by someone set up to test MIPS16.

* FRV - see comment#9 - could do with knowledge of the intent behind the C 
functions such as __uitod and again with someone to test on FRV.

* US_SOFTWARE_GOFAST - should be removed - see my list at 
<http://gcc.gnu.org/ml/gcc/2006-05/msg00440.html> of the various pieces to 
remove.

* powerpc-linux glibc -mabi=ieeelongdouble - not supported by glibc in any 
meaningful way but it does provide the ABI-mandated functions for 
arithmetic on IEEE long double; however, there is a glibc bug whereby it 
provides _q_uitoq instead of the correct name _q_utoq which GCC will now 
call.  There is no GCC bug here since GCC calls the ABI-specified 
function.

Comment 30 Mark Mitchell 2006-06-04 19:06:31 UTC
Joseph --

Thanks for the update.  I'll approve the removal of the GOFAST code, but that's just a cleanup, so no hurry.  I'll mark as P2, for the MIPS16 code.  (MIPS is a primary platform; MIPS16 is arguably part of that, although a less important bit.)

-- Mark
Comment 31 rsandifo@gcc.gnu.org 2006-06-04 20:46:15 UTC
FYI, see:

http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01010.html

about the MIPS16 situation.  To summarise, mips16.S should be considered
legacy code, and I've never seen a report of it being used (never mind
recently).  I don't think there's any point changing it; either we
should just leave it as it is (in the hope that it does someone some
good somewhere) or remove the MIPS16 hard-float support entirely.

I'd rather not do the latter just yet though.  I suspect MIPS will
be submitting more MIPS16e patches when we get to stage 1, so I think
removal of this code should wait until 4.3 at the earliest.

Richard
Comment 32 Mark Mitchell 2006-08-22 22:05:01 UTC
Since this bug is now just about MIPS16 and FRV, and since the MIPS16 bits are said to be basically irrelevant, I've reprioritized this as P5.
Comment 33 Mark Mitchell 2007-05-14 22:27:53 UTC
Will not be fixed in 4.2.0; retargeting at 4.2.1.
Comment 34 Sandra Loosemore 2007-08-05 22:39:20 UTC
It is possible that this patch on mainline has added at least some of the missing support for MIPS16.

http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00057.html
Comment 35 Mark Mitchell 2007-10-09 19:22:18 UTC
Change target milestone to 4.2.3, as 4.2.2 has been released.
Comment 36 mmokrejs 2007-12-17 10:08:16 UTC
I am getting this with 4.2.2 on ARM926EJ-S processor during bootstrap.

rm -rf libbackend.a
ar rc libbackend.a double-int.o tree-chrec.o tree-scalar-evolution.o tree-data-ref.o tree-cfg.o tree-dfa.o tree-eh.o tree-ssa.o tree-optimize.o tree-gimple.o gimplify.o tree-pretty-print.o tree-into-sso
ranlib  libbackend.a
/scratch/gcc-4.2.2/objdir/./prev-gcc/xgcc -B/scratch/gcc-4.2.2/objdir/./prev-gcc/ -B/usr/local/arm-linux-uclibc/bin/   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototype\
          main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
libbackend.a(timevar.o): In function `timevar_print':
../../gcc/timevar.c:459: undefined reference to `__floatunsisf'
../../gcc/timevar.c:459: undefined reference to `__floatunsisf'
libbackend.a(ggc-page.o): In function `ggc_collect':
../../gcc/ggc-page.c:1880: undefined reference to `__floatunsisf'
../../gcc/ggc-page.c:1884: undefined reference to `__floatunsisf'
collect2: ld returned 1 exit status
make[3]: *** [cc1-dummy] Error 1
make[3]: Leaving directory `/scratch/gcc-4.2.2/objdir/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/scratch/gcc-4.2.2/objdir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/scratch/gcc-4.2.2/objdir'
make: *** [bootstrap] Error 2
# /scratch/gcc-4.2.2/objdir/./prev-gcc/xgcc -v
Using built-in specs.
Target: arm-linux-uclibc
Configured with: ../configure --host=arm-linux-uclibc --target=arm-linux-uclibc --enable-languages=c,c++,objc --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-threads --enable-multilib --with-float=soft
Thread model: posix
gcc version 4.2.2
#
Comment 37 rsandifo@gcc.gnu.org 2008-01-25 09:54:03 UTC
To reinforce comment #34, the MIPS16 hard-float support has
been overhauled in 4.3, with this and many other bugs fixed.
The MIPS16 problem therefore "only" affects 4.2 now.

The description of the situation in comment #31 still applies
to 4.2.  The 4.3 work showed that the hard-float support had
bitrotted significantly, and I doubt it is practically usable
in 4.2 regardless of this PR.
Comment 38 Joseph S. Myers 2008-02-01 16:52:49 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 39 Joseph S. Myers 2008-05-19 20:22:41 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 40 Joseph S. Myers 2009-03-31 19:02:22 UTC
Closing 4.2 branch.
Comment 41 Richard Biener 2009-08-04 12:27:20 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 42 Richard Biener 2010-05-22 18:10:47 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 43 Joseph S. Myers 2010-12-15 23:10:08 UTC
I have committed the US_SOFTWARE_GOFAST removal.  The only remaining piece before this PR can be closed is the FRV piece.  FRV maintainers, please see comment#9.
Comment 44 Richard Biener 2011-06-27 12:12:44 UTC
4.3 branch is being closed, moving to 4.4.7 target.
Comment 45 Jakub Jelinek 2012-03-13 12:45:26 UTC
4.4 branch is being closed, moving to 4.5.4 target.
Comment 46 Jakub Jelinek 2013-04-12 15:16:02 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 47 Richard Biener 2014-06-12 13:42:38 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 48 Jakub Jelinek 2014-12-19 13:32:28 UTC
GCC 4.8.4 has been released.
Comment 49 Richard Biener 2015-06-23 08:14:49 UTC
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
Comment 50 Jakub Jelinek 2015-06-26 19:56:56 UTC
GCC 4.9.3 has been released.
Comment 51 Jeffrey A. Law 2016-03-07 18:43:35 UTC
MEP was the last target that needed updating and it has been deprecated.  Thus, I'm closing this BZ as resolved.