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

c++/2084: LONG_LONG_MAX causes ice in tree_low_cst (namespaces)



>Number:         2084
>Category:       c++
>Synopsis:       LONG_LONG_MAX causes ice in tree_low_cst (namespaces)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 24 10:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        3.0 20010223 (prerelease)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.1 #33 Thu Feb 15 12:51:39 CET 2001 i686 unknown
Architecture: i686
SuSE 7.1
Glibc 2.2
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long
>Description:
The compilation of the file ti.C causes an internal compiler error. If
the constant LONG_LONG_MAX, from limit.h, is replaced by a smaller
value no internal error occurs. Note that the compiler was configured
with --enable-long-long, if that makes a difference. 

G++-2.95.2 has no problems compiling the file ti.C.

>How-To-Repeat:
Source file ti.C

#define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)

template<class T>
struct A {};

namespace out
{

    template<class T>
    class B : A<T> {};

    namespace in
    {
        template<class T, T min_val, T max_val>
        class C {};
    } // namespace in

    template<>
    class B<long long>
        : public A<long long>,
          public in::C<long long, LONG_LONG_MIN, LONG_LONG_MAX>
    { };

} // namespace out

int main()
{
}

Compiling the source file ti.C
g++ -v -o it it.C -W -Wall -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long
gcc version 3.0 20010223 (prerelease)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cpp0 -lang-c++ -D_GNU_SOURCE -D__GNUG__=3 -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -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__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ it.C it.ii
GNU CPP version 3.0 20010223 (prerelease) (cpplib) (i386 Linux/ELF)
#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
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -fpreprocessed it.ii -quiet -dumpbase it.C -W -Wall -version -o it.s
GNU CPP version 3.0 20010223 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0 20010223 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.0 20010221 (prerelease).
it.C:23: Internal compiler error in tree_low_cst, at tree.c:3388
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Preprocessed source file it.ii

# 4 "it.C"
template<class T>
struct A {};

namespace out
{

    template<class T>
    class B : A<T> {};

    namespace in
    {
        template<class T, T min_val, T max_val>
        class C {};
    }

    template<>
    class B<long long>
        : public A<long long>,
          public in::C<long long, (-9223372036854775807LL -1), 9223372036854775807LL>
    { };

}

int main()
{
}

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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