Please see attached file for information specified in the bug reporting instructions
Created attachment 9161 [details] information specified in the bug reporting instructions
Reduced testcase: #include <typeinfo> template<int> struct function1 { function1(void (*f)(void)) { typeid(int (*)(char&)); } }; void inputclassifier(void){} function1<1> b(inputclassifier) ; ---- -frepo is only needed to reproduce this. This has been failing since at least "3.5.0 20040909".
we get this ICE: t.cc:11: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. And the backtrace: #0 0x08134f2e in repo_emit_p (decl=0xb7cc257c) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/ cp/repo.c:288 #1 0x080ca298 in import_export_decl (decl=0xb7cc257c) at /home/peshtigo/pinskia/src/gnu/gcc/ src/gcc/cp/decl2.c:1726 #2 0x080f3e30 in emit_tinfo_decl (decl=0xb7cc257c) at /home/peshtigo/pinskia/src/gnu/gcc/src/ gcc/cp/rtti.c:1465 #3 0x080cdc95 in cp_finish_file () at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/decl2.c:2883 #4 0x08184b0f in c_common_parse_file (set_yydebug=0) at /home/peshtigo/pinskia/src/gnu/gcc/ src/gcc/c-opts.c:1119 #5 0x08493b15 in toplev_main (argc=0, argv=0xbff1a054) at /home/peshtigo/pinskia/src/gnu/gcc/ src/gcc/toplev.c:966 #6 0x003e7ad4 in __libc_start_main () from /lib/tls/libc.so.6 #7 0x08049b21 in _start () 287 if (!DECL_TEMPLATE_INSTANTIATION (decl) 288 && !CLASSTYPE_TEMPLATE_INSTANTIATION (type)) <--- here The type which is crashing on (it is not a template at all but a pointer to a function type): (gdb) p debug_generic_expr (type) intD.2 (*<T380>) (void) <pointer_type 0xb7d4fa8c type <function_type 0xb7cb1c3c type <integer_type 0xb7ca057c int public type_6 SI size <integer_cst 0xb7c983f0 constant invariant 32> unit size <integer_cst 0xb7c98180 constant invariant 4> align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0xb7c983a8 -2147483648> max <integer_cst 0xb7c983c0 2147483647> pointer_to_this <pointer_type 0xb7cafdec>> QI size <integer_cst 0xb7c981f8 constant invariant 8> unit size <integer_cst 0xb7c98210 constant invariant 1> align 8 symtab 0 alias set -1 arg-types <tree_list 0xb7c98c48 value <void_type 0xb7caf9b4 void>> pointer_to_this <pointer_type 0xb7d4fa8c>> unsigned SI size <integer_cst 0xb7c983f0 32> unit size <integer_cst 0xb7c98180 4> align 32 symtab 0 alias set -1>
And another testcase, this time with an array: #include <typeinfo> template<int> struct function1 { function1() { typeid(int[100]); } }; function1<1> b;
Subject: Bug 22204 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2005-07-16 00:25:01 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog repo.c Added files: gcc/testsuite/g++.dg/rtti: repo1.C Log message: PR c++/22204 * repo.c (repo_emit_p): Robustify. PR c++/22204 * g++.dg/rtti/repo1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5773&r2=1.5774 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/repo1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4821&r2=1.4822 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/repo.c.diff?cvsroot=gcc&r1=1.58&r2=1.59
Subject: Bug 22204 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: mmitchel@gcc.gnu.org 2005-07-16 01:11:53 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog repo.c Added files: gcc/testsuite/g++.dg/rtti: repo1.C Log message: PR c++/22204 * repo.c (repo_emit_p): Robustify. PR c++/22204 * g++.dg/rtti/repo1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.280&r2=1.5084.2.281 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/repo1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.67&r2=1.4648.2.68 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/repo.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.54&r2=1.54.18.1
Fixed in 4.0.2.
*** Bug 23388 has been marked as a duplicate of this bug. ***