This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
RTEMS patch sweep: bogus implicit int32 in libm
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: Newlib List <newlib at sources dot redhat dot com>
- Cc: Joel Sherrill <joel dot sherrill at OARcorp dot com>, Eric Norum <norume at aps dot anl dot gov>, Chris Johns <chrisj at rtems dot org>
- Date: Thu, 24 Feb 2005 09:50:28 +0100
- Subject: RTEMS patch sweep: bogus implicit int32 in libm
Hi,
Yet another RTEMS patch ...
The patch below is supposed to fix this bug below, gcc-4.0 reveals for
some multilib variants of the h8300 (probably for the avr, too). For
these targets, sizeof(int) == 16bit, not 32bit as the code in newlib
implicitly assumes.
/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/xgcc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/ -nostdinc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/newlib/ -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/newlib/targ-include -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/gcc-4.0.0/newlib/libc/include -B/opt/rtems-4.7/h8300-rtems4.7/bin/ -B/opt/rtems-4.7/h8300-rtems4.7/lib/ -isystem /opt/rtems-4.7/h8300-rtems4.7/include -isystem /opt/rtems-4.7/h8300-rtems4.7/sys-include -DPACKAGE=\"newlib\" -DVERSION=\"1.13.0\" -I. -I../../../../../gcc-4.0.0/newlib/libm/common -O2 -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL -fno-builtin -O2 -g -O2 -c ../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c: In function '__fpclassifyf':
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:16: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:18: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:18: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:19: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:19: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:21: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:22: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:22: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:24: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:24: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c: In function '__fpclassifyd':
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:38: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:40: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:40: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:41: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:41: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:43: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:44: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:44: warning: comparison is always true due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:47: warning: comparison is always false due to limited range of data type
../../../../../gcc-4.0.0/newlib/libm/common/s_fpclassify.c:48: warning: comparison is always false due to limited range of data type
Ralf
Index: libm/common/s_fpclassify.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/s_fpclassify.c,v
retrieving revision 1.2
diff -u -r1.2 s_fpclassify.c
--- libm/common/s_fpclassify.c 27 Jun 2003 20:12:01 -0000 1.2
+++ libm/common/s_fpclassify.c 24 Feb 2005 08:40:09 -0000
@@ -9,7 +9,7 @@
int
__fpclassifyf (float x)
{
- unsigned int w;
+ __uint32_t w;
GET_FLOAT_WORD(w,x);
@@ -30,7 +30,7 @@
int
__fpclassifyd (double x)
{
- unsigned int msw, lsw;
+ __int32_t msw, lsw;
EXTRACT_WORDS(msw,lsw,x);
Index: libm/common/sf_round.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/sf_round.c,v
retrieving revision 1.1
diff -u -r1.1 sf_round.c
--- libm/common/sf_round.c 7 Jun 2002 21:59:56 -0000 1.1
+++ libm/common/sf_round.c 24 Feb 2005 08:40:09 -0000
@@ -19,7 +19,7 @@
#endif
{
int signbit;
- int w;
+ __int32_t w;
/* Most significant word, least significant word. */
int exponent_less_127;