This is the mail archive of the gcc@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]

Re: New boost regressions since yesterday for gcc 3.0.1




On 14 Aug 2001, Gabriel Dos Reis wrote:

> Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de> writes:
> 
> | There are two new failures when running the boost regression test
> | suite vs gcc 3.0.1 on the i686-pc-linux-gnu target. These problems were
> | not present yesterday. 
> 
> Peter,
> 
>   Please, could you tell me where those DBL_MAX are coming from?  We
> don't use those symbols in <limits>
> 
> [...]
> 
> | **** test failed: traits::const_max == traits::max(), file: ../libs/integer/integer_traits_test.cpp, line: 50
> | Checking short; min is -32768, max is 32767
> | Checking unsigned short; min is 0, max is 65535
> | Checking int; min is -2147483648, max is 2147483647
> | Checking unsigned int; min is 0, max is 4294967295
> | Checking long; min is -2147483648, max is 2147483647
> | Checking unsigned long; min is 0, max is 4294967295
> | Checking int64_t (possibly long long); min is -9223372036854775808, max is 9223372036854775807
> | Checking uint64_t (possibly unsigned long long); min is 0, max is 18446744073709551615
> 
> What is wrong with the above?
> 
> -- Gaby
> 

I narrowed the first problem down to the following test case tc.C.

In contrast to gcc 3.0.1 of today which rejects this source code, gcc
3.0 compiles this code without a problem. I believe this behaviour is
due to the fact that the bits/std_climits.h file from the gcc 3.0
compiler includes <bits/std_cfloat.h>, in contrast to the file that is
installed for gcc 3.0.1. If I manually add the line #include
<bits/std_cfloat.h> to the  std_limits.h file the behaviour of gcc 3.0.1
is the same as for gcc 3.0.

The following patch does just add this line, but I do not know if this
is the best, or even a correct solution.

2001-08-15  Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>

	* include/bits/std_limits.h: Include <bits/std_cfloat.h>.

Hope this helps,

Peter Schmid

*** libstdc++-v3/include/bits/std_limits.h.orig	Tue Aug 14 19:04:22 2001
--- libstdc++-v3/include/bits/std_limits.h	Tue Aug 14 19:04:46 2001
***************
*** 41,46 ****
--- 41,47 ----
  #pragma GCC system_header
  
  #include <bits/c++config.h>
+ #include <bits/std_cfloat.h>
  
  //
  // The numeric_limits<> traits document implementation-defined aspects

************************
Source code tc.C
#include <limits>

int main()
{
    double a = DBL_MAX ; 
}  

g++ 3.0.1
g++ -v -W -Wall tc.C
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc/configure --enable-shared --enable-threads=posix --enable-languages=c,c++,f77,objc --disable-nls --enable-clocale=gnu
Thread model: posix
gcc version 3.0.1 20010814 (prerelease)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tc.C -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase tc.C -W -Wall -version -o /tmp/ccEqgPgc.s
GNU CPP version 3.0.1 20010814 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.1 20010814 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.0.1 20010814 (prerelease).
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include
 /usr/include
End of search list.
tc.C: In function `int main()':
tc.C:5: `DBL_MAX' undeclared (first use this function)
tc.C:5: (Each undeclared identifier is reported only once for each function it 
   appears in.)
tc.C:5: warning: unused variable `double a'

g++ 3.0
g++ -v -W -Wall tc.C
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc-3.0/configure --enable-shared --enable-threads=posix --enable-languages=c,c++,f77,objc --disable-nls
Thread model: posix
gcc version 3.0
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tc.C -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase tc.C -W -Wall -version -o /tmp/ccvYf4Zh.s
GNU CPP version 3.0 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0 (i686-pc-linux-gnu)
	compiled by GNU C version 3.0.
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
 /usr/include
End of search list.
tc.C: In function `int main()':
tc.C:5: warning: unused variable `double a'
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccUyvpFH.o /tmp/ccvYf4Zh.s
GNU assembler version 2.11.90.0.23 (i686-pc-linux-gnu) using BFD version 2.11.90.0.23
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../.. /tmp/ccUyvpFH.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/crtend.o /usr/lib/crtn.o




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