This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix bootstrap/26050


This fixes the bootstrap problem caused by relying on availability of
u_int32_t by using uint32_t and falling back to a _stdint.h header.

Works on i686-pc-linux-gnu, bootstrap on x86_64-unknown-linux-gnu with
the other bootstrap fixes combined in progress.

Ok for mainline if it succeeds?

Thanks,
Richard.

2006-02-01  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/26050
	* configure.ac: Generate _stdint.h using GCC_HEADER_STDINT.
	* configure: Re-generate.
	* Makefile.in: Likewise. 
	* aclocal.m4: Likewise.
	* i386/Makefile.am: Adjust include path.
	* i386/Makefile.in: Re-generate.
	* include/math_private.h: Do not include sys/types.h.
	Include _stdint.h.  Use uint32_t instead of u_int32_t.
	* flt-32/e_expf.c: Do not include inttypes.h
	* flt-32/e_sqrtf.c: Use uint32_t instead of u_int32_t.
	* flt-32/s_floorf.c: Likewise.
	* flt-32/e_atan2f.c: Likewise.
	* flt-32/e_powf.c: Likewise.
	* flt-32/e_rem_pio2f.c: Likewise.
	* flt-32/e_log10f.c: Likewise.
	* dbl-64/s_floor.c: Likewise.
	* dbl-64/e_log10.c: Likewise.
	* dbl-64/e_rem_pio2.c: Likewise.

Index: Makefile.in
===================================================================
*** Makefile.in	(revision 110473)
--- Makefile.in	(working copy)
*************** subdir = .
*** 47,53 ****
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
  	$(top_srcdir)/../config/lead-dot.m4 \
! 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
--- 47,54 ----
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
  	$(top_srcdir)/../config/lead-dot.m4 \
! 	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
*************** DEPDIR = @DEPDIR@
*** 127,132 ****
--- 128,134 ----
  ECHO_C = @ECHO_C@
  ECHO_N = @ECHO_N@
  ECHO_T = @ECHO_T@
+ EGREP = @EGREP@
  EXEEXT = @EXEEXT@
  INSTALL_DATA = @INSTALL_DATA@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: include/math_private.h
===================================================================
*** include/math_private.h	(revision 110473)
--- include/math_private.h	(working copy)
***************
*** 18,24 ****
  #define _MATH_PRIVATE_H_
  
  #include <endian.h>
! #include <sys/types.h>
  
  /* The original fdlibm code used statements like:
  	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
--- 18,24 ----
  #define _MATH_PRIVATE_H_
  
  #include <endian.h>
! #include "_stdint.h"
  
  /* The original fdlibm code used statements like:
  	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
*************** typedef union
*** 41,48 ****
    double value;
    struct
    {
!     u_int32_t msw;
!     u_int32_t lsw;
    } parts;
  } ieee_double_shape_type;
  
--- 41,48 ----
    double value;
    struct
    {
!     uint32_t msw;
!     uint32_t lsw;
    } parts;
  } ieee_double_shape_type;
  
*************** typedef union
*** 55,62 ****
    double value;
    struct
    {
!     u_int32_t lsw;
!     u_int32_t msw;
    } parts;
  } ieee_double_shape_type;
  
--- 55,62 ----
    double value;
    struct
    {
!     uint32_t lsw;
!     uint32_t msw;
    } parts;
  } ieee_double_shape_type;
  
*************** do {								\
*** 126,132 ****
  typedef union
  {
    float value;
!   u_int32_t word;
  } ieee_float_shape_type;
  
  /* Get a 32 bit int from a float.  */
--- 126,132 ----
  typedef union
  {
    float value;
!   uint32_t word;
  } ieee_float_shape_type;
  
  /* Get a 32 bit int from a float.  */
Index: configure.ac
===================================================================
*** configure.ac	(revision 110473)
--- configure.ac	(working copy)
*************** else
*** 123,128 ****
--- 123,129 ----
    multilib_arg=
  fi
  
+ GCC_HEADER_STDINT
  
  # Check for target library dependencies
  cannot_build=no
Index: flt-32/e_sqrtf.c
===================================================================
*** flt-32/e_sqrtf.c	(revision 110473)
--- flt-32/e_sqrtf.c	(working copy)
*************** static	float	one	= 1.0, tiny=1.0e-30;
*** 36,42 ****
  	float z;
  	int32_t sign = (int)0x80000000; 
  	int32_t ix,s,q,m,t,i;
! 	u_int32_t r;
  
  	GET_FLOAT_WORD(ix,x);
  
--- 36,42 ----
  	float z;
  	int32_t sign = (int)0x80000000; 
  	int32_t ix,s,q,m,t,i;
! 	uint32_t r;
  
  	GET_FLOAT_WORD(ix,x);
  
Index: flt-32/e_expf.c
===================================================================
*** flt-32/e_expf.c	(revision 110473)
--- flt-32/e_expf.c	(working copy)
***************
*** 53,59 ****
  #include <float.h>
  #include <ieee754.h>
  #include <math.h>
- #include <inttypes.h>
  #include <math_private.h>
  
  extern const float __exp_deltatable[178];
--- 53,58 ----
Index: flt-32/s_floorf.c
===================================================================
*** flt-32/s_floorf.c	(revision 110473)
--- flt-32/s_floorf.c	(working copy)
*************** static float huge = 1.0e30;
*** 43,49 ****
  #endif
  {
  	int32_t i0,j0;
! 	u_int32_t i;
  	GET_FLOAT_WORD(i0,x);
  	j0 = ((i0>>23)&0xff)-0x7f;
  	if(j0<23) {
--- 43,49 ----
  #endif
  {
  	int32_t i0,j0;
! 	uint32_t i;
  	GET_FLOAT_WORD(i0,x);
  	j0 = ((i0>>23)&0xff)-0x7f;
  	if(j0<23) {
Index: flt-32/e_atan2f.c
===================================================================
*** flt-32/e_atan2f.c	(revision 110473)
--- flt-32/e_atan2f.c	(working copy)
*************** pi_lo   = -8.7422776573e-08; /* 0xb3bbbd
*** 93,99 ****
  	switch (m) {
  	    case 0: return       z  ;	/* atan(+,+) */
  	    case 1: {
! 	    	      u_int32_t zh;
  		      GET_FLOAT_WORD(zh,z);
  		      SET_FLOAT_WORD(z,zh ^ 0x80000000);
  		    }
--- 93,99 ----
  	switch (m) {
  	    case 0: return       z  ;	/* atan(+,+) */
  	    case 1: {
! 	    	      uint32_t zh;
  		      GET_FLOAT_WORD(zh,z);
  		      SET_FLOAT_WORD(z,zh ^ 0x80000000);
  		    }
Index: flt-32/e_powf.c
===================================================================
*** flt-32/e_powf.c	(revision 110473)
--- flt-32/e_powf.c	(working copy)
*************** ivln2_l  =  7.0526075433e-06; /* 0x36eca
*** 133,139 ****
  	}
  
      /* (x<0)**(non-int) is NaN */
! 	if(((((u_int32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
  
      /* |y| is huge */
  	if(iy>0x4d000000) { /* if |y| > 2**27 */
--- 133,139 ----
  	}
  
      /* (x<0)**(non-int) is NaN */
! 	if(((((uint32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
  
      /* |y| is huge */
  	if(iy>0x4d000000) { /* if |y| > 2**27 */
*************** ivln2_l  =  7.0526075433e-06; /* 0x36eca
*** 204,210 ****
  	}
  
  	s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
! 	if(((((u_int32_t)hx>>31)-1)|(yisint-1))==0)
  	    s = -one;	/* (-ve)**(odd int) */
  
      /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
--- 204,210 ----
  	}
  
  	s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
! 	if(((((uint32_t)hx>>31)-1)|(yisint-1))==0)
  	    s = -one;	/* (-ve)**(odd int) */
  
      /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
*************** ivln2_l  =  7.0526075433e-06; /* 0x36eca
*** 221,227 ****
  	}
  	else if ((j&0x7fffffff)>0x43160000)		/* z <= -150 */
  	    return s*tiny*tiny;				/* underflow */
! 	else if ((u_int32_t) j==0xc3160000){		/* z == -150 */
  	    if(p_l<=z-p_h) return s*tiny*tiny;		/* underflow */
  	}
      /*
--- 221,227 ----
  	}
  	else if ((j&0x7fffffff)>0x43160000)		/* z <= -150 */
  	    return s*tiny*tiny;				/* underflow */
! 	else if ((uint32_t) j==0xc3160000){		/* z == -150 */
  	    if(p_l<=z-p_h) return s*tiny*tiny;		/* underflow */
  	}
      /*
Index: flt-32/e_rem_pio2f.c
===================================================================
*** flt-32/e_rem_pio2f.c	(revision 110473)
--- flt-32/e_rem_pio2f.c	(working copy)
*************** pio2_3t =  6.1232342629e-17; /* 0x248d31
*** 148,154 ****
  	    if(n<32&&(int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) {
  		y[0] = r-w;	/* quick check no cancellation */
  	    } else {
! 	        u_int32_t high;
  	        j  = ix>>23;
  	        y[0] = r-w;
  		GET_FLOAT_WORD(high,y[0]);
--- 148,154 ----
  	    if(n<32&&(int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) {
  		y[0] = r-w;	/* quick check no cancellation */
  	    } else {
! 	        uint32_t high;
  	        j  = ix>>23;
  	        y[0] = r-w;
  		GET_FLOAT_WORD(high,y[0]);
Index: flt-32/e_log10f.c
===================================================================
*** flt-32/e_log10f.c	(revision 110473)
--- flt-32/e_log10f.c	(working copy)
*************** static float zero   =  0.0;
*** 58,64 ****
          }
  	if (hx >= 0x7f800000) return x+x;
  	k += (hx>>23)-127;
! 	i  = ((u_int32_t)k&0x80000000)>>31;
          hx = (hx&0x007fffff)|((0x7f-i)<<23);
          y  = (float)(k+i);
  	SET_FLOAT_WORD(x,hx);
--- 58,64 ----
          }
  	if (hx >= 0x7f800000) return x+x;
  	k += (hx>>23)-127;
! 	i  = ((uint32_t)k&0x80000000)>>31;
          hx = (hx&0x007fffff)|((0x7f-i)<<23);
          y  = (float)(k+i);
  	SET_FLOAT_WORD(x,hx);
Index: dbl-64/s_floor.c
===================================================================
*** dbl-64/s_floor.c	(revision 110473)
--- dbl-64/s_floor.c	(working copy)
*************** static double huge = 1.0e300;
*** 40,46 ****
  #endif
  {
  	int32_t i0,i1,j0;
! 	u_int32_t i,j;
  	EXTRACT_WORDS(i0,i1,x);
  	j0 = ((i0>>20)&0x7ff)-0x3ff;
  	if(j0<20) {
--- 40,46 ----
  #endif
  {
  	int32_t i0,i1,j0;
! 	uint32_t i,j;
  	EXTRACT_WORDS(i0,i1,x);
  	j0 = ((i0>>20)&0x7ff)-0x3ff;
  	if(j0<20) {
*************** static double huge = 1.0e300;
*** 62,68 ****
  	    if(j0==0x400) return x+x;	/* inf or NaN */
  	    else return x;		/* x is integral */
  	} else {
! 	    i = ((u_int32_t)(0xffffffff))>>(j0-20);
  	    if((i1&i)==0) return x;	/* x is integral */
  	    if(huge+x>0.0) { 		/* raise inexact flag */
  		if(i0<0) {
--- 62,68 ----
  	    if(j0==0x400) return x+x;	/* inf or NaN */
  	    else return x;		/* x is integral */
  	} else {
! 	    i = ((uint32_t)(0xffffffff))>>(j0-20);
  	    if((i1&i)==0) return x;	/* x is integral */
  	    if(huge+x>0.0) { 		/* raise inexact flag */
  		if(i0<0) {
Index: dbl-64/e_log10.c
===================================================================
*** dbl-64/e_log10.c	(revision 110473)
--- dbl-64/e_log10.c	(working copy)
*************** static double zero   =  0.0;
*** 75,81 ****
  {
  	double y,z;
  	int32_t i,k,hx;
! 	u_int32_t lx;
  
  	EXTRACT_WORDS(hx,lx,x);
  
--- 75,81 ----
  {
  	double y,z;
  	int32_t i,k,hx;
! 	uint32_t lx;
  
  	EXTRACT_WORDS(hx,lx,x);
  
*************** static double zero   =  0.0;
*** 89,95 ****
          }
  	if (hx >= 0x7ff00000) return x+x;
  	k += (hx>>20)-1023;
! 	i  = ((u_int32_t)k&0x80000000)>>31;
          hx = (hx&0x000fffff)|((0x3ff-i)<<20);
          y  = (double)(k+i);
  	SET_HIGH_WORD(x,hx);
--- 89,95 ----
          }
  	if (hx >= 0x7ff00000) return x+x;
  	k += (hx>>20)-1023;
! 	i  = ((uint32_t)k&0x80000000)>>31;
          hx = (hx&0x000fffff)|((0x3ff-i)<<20);
          y  = (double)(k+i);
  	SET_HIGH_WORD(x,hx);
Index: dbl-64/e_rem_pio2.c
===================================================================
*** dbl-64/e_rem_pio2.c	(revision 110473)
--- dbl-64/e_rem_pio2.c	(working copy)
*************** pio2_3t =  8.47842766036889956997e-32; /
*** 93,99 ****
  	double z,w,t,r,fn;
  	double tx[3];
  	int32_t e0,i,j,nx,n,ix,hx;
! 	u_int32_t low;
  
  	GET_HIGH_WORD(hx,x);		/* high word of x */
  	ix = hx&0x7fffffff;
--- 93,99 ----
  	double z,w,t,r,fn;
  	double tx[3];
  	int32_t e0,i,j,nx,n,ix,hx;
! 	uint32_t low;
  
  	GET_HIGH_WORD(hx,x);		/* high word of x */
  	ix = hx&0x7fffffff;
*************** pio2_3t =  8.47842766036889956997e-32; /
*** 133,139 ****
  	    if(n<32&&ix!=npio2_hw[n-1]) {	
  		y[0] = r-w;	/* quick check no cancellation */
  	    } else {
! 	        u_int32_t high;
  	        j  = ix>>20;
  	        y[0] = r-w; 
  		GET_HIGH_WORD(high,y[0]);
--- 133,139 ----
  	    if(n<32&&ix!=npio2_hw[n-1]) {	
  		y[0] = r-w;	/* quick check no cancellation */
  	    } else {
! 	        uint32_t high;
  	        j  = ix>>20;
  	        y[0] = r-w; 
  		GET_HIGH_WORD(high,y[0]);
Index: i386/Makefile.in
===================================================================
*** i386/Makefile.in	(revision 110473)
--- i386/Makefile.in	(working copy)
*************** DIST_COMMON = $(srcdir)/Makefile.am $(sr
*** 42,48 ****
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
  	$(top_srcdir)/../config/lead-dot.m4 \
! 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
--- 42,49 ----
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
  	$(top_srcdir)/../config/lead-dot.m4 \
! 	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
*************** DEPDIR = @DEPDIR@
*** 112,117 ****
--- 113,119 ----
  ECHO_C = @ECHO_C@
  ECHO_N = @ECHO_N@
  ECHO_T = @ECHO_T@
+ EGREP = @EGREP@
  EXEEXT = @EXEEXT@
  INSTALL_DATA = @INSTALL_DATA@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
*************** toolexeclibdir = @toolexeclibdir@
*** 197,203 ****
  # May be used by various substitution variables.
  gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
  noinst_LTLIBRARIES = libsse2.la
! libsse2_la_CFLAGS = -I@srcdir@/../include -include @srcdir@/sse2.h \
    -Wall -O2 -g -msse2 -msseregparm -mfpmath=sse -march=pentium3 \
    -fno-math-errno -fno-trapping-math -ffinite-math-only \
    -fno-rounding-math -fno-signaling-nans -D__NO_MATH_INLINES
--- 199,205 ----
  # May be used by various substitution variables.
  gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
  noinst_LTLIBRARIES = libsse2.la
! libsse2_la_CFLAGS = -I@srcdir@/../include -I.. -include @srcdir@/sse2.h \
    -Wall -O2 -g -msse2 -msseregparm -mfpmath=sse -march=pentium3 \
    -fno-math-errno -fno-trapping-math -ffinite-math-only \
    -fno-rounding-math -fno-signaling-nans -D__NO_MATH_INLINES
Index: i386/Makefile.am
===================================================================
*** i386/Makefile.am	(revision 110473)
--- i386/Makefile.am	(working copy)
*************** gcc_version := $(shell cat $(top_srcdir)
*** 10,16 ****
  
  noinst_LTLIBRARIES = libsse2.la
  
! libsse2_la_CFLAGS = -I@srcdir@/../include -include @srcdir@/sse2.h \
    -Wall -O2 -g -msse2 -msseregparm -mfpmath=sse -march=pentium3 \
    -fno-math-errno -fno-trapping-math -ffinite-math-only \
    -fno-rounding-math -fno-signaling-nans -D__NO_MATH_INLINES
--- 10,16 ----
  
  noinst_LTLIBRARIES = libsse2.la
  
! libsse2_la_CFLAGS = -I@srcdir@/../include -I.. -include @srcdir@/sse2.h \
    -Wall -O2 -g -msse2 -msseregparm -mfpmath=sse -march=pentium3 \
    -fno-math-errno -fno-trapping-math -ffinite-math-only \
    -fno-rounding-math -fno-signaling-nans -D__NO_MATH_INLINES
Index: aclocal.m4
===================================================================
*** aclocal.m4	(revision 110473)
--- aclocal.m4	(working copy)
*************** AC_SUBST([am__untar])
*** 937,940 ****
--- 937,941 ----
  
  m4_include([../config/depstand.m4])
  m4_include([../config/lead-dot.m4])
+ m4_include([../config/stdint.m4])
  m4_include([../libtool.m4])


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]