c++/8046: ICE on (admittedly very silly) input

andrewp@andypo.net andrewp@andypo.net
Wed Sep 25 15:06:00 GMT 2002


>Number:         8046
>Category:       c++
>Synopsis:       ICE on (admittedly very silly) input
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 25 14:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pollard
>Release:        3.2.1 20020914 (prerelease)
>Organization:
>Environment:
System: Linux garfield.andypo.net 2.4.18-10smp #1 SMP Wed Aug 7 11:17:48 EDT 2002 i686 unknown
Binutils: 2.13.90.0.4
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /usr/local/src/cvs/gcc-3_2-branch/configure --prefix=/usr/local/gcc-3.2.1-20020914-i686-pc-linux-gnu --with-gnu-as --with-gnu-ld --enable-version-specific-runtime-libs --enable-threads=posix --with-dwarf2 --disable-shared --enable-languages=c++ --enable-__cxa_atexit
>Description:
The following (admittedly very silly) code fragment causes an ICE in all gcc
versions I tried (gcc-2.96/gcc-3.0.5/gcc-3.2.1/gcc-3.3)

ice.cxx
----------------------
    struct A {};
    namespace a {}

    void
    foo()
    {
        A a;
        a::~A();
    }
----------------------

% gcc -v
Reading specs from /usr/local/gcc-3.2.1-20020914-i686-pc-linux-gnu/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Configured with: /usr/local/src/cvs/gcc-3_2-branch/configure --prefix=/usr/local/gcc-3.2.1-20020914-i686-pc-linux-gnu --with-gnu-as --with-gnu-ld --enable-version-specific-runtime-libs --enable-threads=posix --with-dwarf2 --disable-shared --enable-languages=c++ --enable-__cxa_atexit
Thread model: posix
gcc version 3.2.1 20020914 (prerelease)
% g++ ice.cxx
ice.cxx: In function `void foo()':
ice.cxx:8: Internal compiler error in lookup_namespace_name, at cp/decl.c:5532
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

This was distilled from a much larger piece of code, but, basically, what
I meant to do was

    a.~A();

and not

    a::~A();

to call the destructor. A polite error message pointing out that I had
submitted complete garbage to the compiler would have been better than
the ICE :-)
>How-To-Repeat:
Compile the above code fragment.
>Fix:
Don't do something as daft as what I actually did.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list