Bug 52837 - ICE in cp/mangle.c:3306
Summary: ICE in cp/mangle.c:3306
Status: RESOLVED DUPLICATE of bug 52759
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 22:13 UTC by Matt Godbolt
Modified: 2012-04-03 12:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
This is the .ii file that reproduces the problem. (gzipped to get past upload limitations) (327.81 KB, application/x-gzip)
2012-04-02 22:17 UTC, Matt Godbolt
Details
Minimal reproducible test case (131 bytes, text/x-c++src)
2012-04-02 22:52 UTC, Matt Godbolt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Godbolt 2012-04-02 22:13:30 UTC
GCC version: 4.7.0 (custom build)
System type: Ubuntu 11.10 3.0.0-16-generic
$ /site/apps/gcc-4.7.0-drw.2/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/site/apps/gcc-4.7.0-drw.2/bin/gcc
COLLECT_LTO_WRAPPER=/site/apps/gcc-4.7.0-drw.2/libexec/gcc/x86_64-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ./configure --prefix /site/apps/gcc-4.7.0-drw.2 --build=x86_64-linux-gnu --enable-clocale=gnu --enable-gold --enable-languages=c,c++ --enable-ld=default --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto --enable-plugin --enable-shared --enable-threads=posix --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-pkgversion=DRW-internal-build --with-plugin-ld=ld.gold --with-system-zlib --with-gmp=/home/prodappadmin/fig-packages/scratch/gcc/4.7.0/build/gmp-5.0.2 --with-mpfr=/home/prodappadmin/fig-packages/scratch/gcc/4.7.0/build/mpfr-3.1.0 --with-mpc=/home/prodappadmin/fig-packages/scratch/gcc/4.7.0/build/mpc-0.9 --with-libelf=/home/prodappadmin/fig-packages/scratch/gcc/4.7.0/build/libelf-0.8.9
Thread model: posix
gcc version 4.7.0 (DRW-internal-build) 

command-line: /site/apps/gcc-4.7.0-drw.2/bin/gcc -MD -g3 -Wall -fPIC -DXP_UNIX -DIN_GCC -DPLUGIN_NO_POISON -DHAVE_CONFIG_H  -I/site/apps/gcc-4.7.0-drw.2/lib/gcc/x86_64-linux-gnu/4.7.0/plugin/include -I/home/mgodbolt/build/objs-js/dist/include -I/home/mgodbolt/build/objs-js/dist/lib -I//home/mgodbolt/local/include/js/  -O2 -x c++ -c util.c

compiler output: 
In file included from /home/mgodbolt/build/objs-js/dist/include/jsval.h:48:0,
                 from /home/mgodbolt/build/objs-js/dist/include/jspubtd.h:47,
                 from /home/mgodbolt/build/objs-js/dist/include/jsapi.h:49,
                 from gcc_compat.h:31,
                 from util.c:21:
/home/mgodbolt/build/objs-js/dist/include/jsutil.h:642:58: internal compiler error: in mangle_decl_string, at cp/mangle.c:3306

....

When compiling the attached file we get an ICE in cp/mangle.c line 3306 (commented "We shouldn't be trying to mangle an uninstantiated template.").

I have been unable to winnow down a more confined example of this error as I am very unfamiliar with the code being built (it's an old version of the mozilla JS runtime).

The error can be reproduced with the attached preprocessed file using simply 
"cc1plus util.ii"
Comment 1 Matt Godbolt 2012-04-02 22:17:15 UTC
Created attachment 27071 [details]
This is the .ii file that reproduces the problem. (gzipped to get past upload limitations)

(attempt at attaching .ii file, first attempt failed).
Comment 2 Matt Godbolt 2012-04-02 22:51:14 UTC
After a little more research, I've managed to get a 4-line reproduction case. (See attached).

I also confirmed this code compiles without error on GCC4.5 and GCC4.6.
Comment 3 Matt Godbolt 2012-04-02 22:52:26 UTC
Created attachment 27072 [details]
Minimal reproducible test case

$ /site/apps/gcc-4.7.0-drw.2/bin/gcc -c gcc-4.7-ice-demangle.cc 
gcc-4.7-ice-demangle.cc:6:58: internal compiler error: in mangle_decl_string, at cp/mangle.c:3306
Comment 4 Jakub Jelinek 2012-04-03 06:49:07 UTC
Dup of PR52759 ?
Comment 5 Matt Godbolt 2012-04-03 12:33:53 UTC
Definite duplicate of 52759. Thanks Jakub.

*** This bug has been marked as a duplicate of bug 52759 ***