public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template
@ 2004-03-02 19:51 bangerth at dealii dot org
  2004-03-02 20:21 ` [Bug c++/14390] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-02 19:51 UTC (permalink / raw)
  To: gcc-bugs

>From the last example in PR 14389: 
---------------------- 
struct S { 
    template< typename _A > void foo(); 
    template< int _i >      void foo(); 
}; 
 
template< typename _A > void S::foo() {} 
 
template void S::foo< 0 >(); 
---------------------- 
 
This ICEs all my compilers like so: 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc:6: internal compiler error: in tsubst, at cp/pt.c:6737 
Please submit a full bug report, 
 
W.

-- 
           Summary: ICE in tsubst with instantiation of overloaded template
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
@ 2004-03-02 20:21 ` pinskia at gcc dot gnu dot org
  2004-03-03  3:34 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-02 20:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-02 20:21 -------
Here is the backtrace for me on the tree-ssa:
#0  fancy_abort (file=0x8a4ae0 "/Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c", line=6737, 
function=0x8a6254 "tsubst") at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/diagnostic.c:584
#1  0x0009b334 in tsubst (t=0x417721f0, args=0x41769d50, complain=tf_error, 
in_decl=0x4177007c) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:6737
#2  0x000934dc in tsubst_template_arg (t=0x417721f0, args=0x41769d50, complain=tf_error, 
in_decl=0x4177007c) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:5684
#3  0x00093780 in tsubst_template_args (t=0x41769c48, args=0x41769d50, complain=tf_error, 
in_decl=0x4177007c) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:5735
#4  0x00096cec in tsubst_decl (t=0x4177007c, args=0x41769d50, type=0x4176ec1c, 
complain=tf_error) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:6080
#5  0x0009a244 in tsubst (t=0x4177007c, args=0x41769d50, complain=tf_error, 
in_decl=0x41770174) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:6634
#6  0x000acb94 in instantiate_template (tmpl=0x41770174, targ_ptr=0x41769d50, 
complain=tf_error) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:8697
#7  0x00076568 in check_explicit_specialization (declarator=0x416a84c8, decl=0x4177283c, 
template_count=0, flags=0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/pt.c:1901
#8  0x00041fb0 in grokfndecl (ctype=0x4176e744, type=0x4176ec1c, declarator=0x4176fc80, 
orig_declarator=0x416a84c8, virtualp=0, flags=NO_SPECIAL, quals=0x0, raises=0x0, check=1, 
friendp=0, publicp=1, inlinep=0, funcdef_flag=0, template_count=0, in_namespace=0x0) at /Users/
pinskia/src/gcc-tree-ssa/gcc/gcc/cp/decl.c:5684
#9  0x0004e8bc in grokdeclarator (declarator=0x416a84c8, declspecs=0x41769ca8, 
decl_context=NORMAL, initialized=0, attrlist=0x0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/
decl.c:8345
#10 0x00132f14 in cp_parser_explicit_instantiation (parser=0x4176e6c8) at /Users/pinskia/src/gcc-
tree-ssa/gcc/gcc/cp/parser.c:8681
#11 0x0012f4a8 in cp_parser_declaration (parser=0x4176e6c8) at /Users/pinskia/src/gcc-tree-ssa/
gcc/gcc/cp/parser.c:6444
#12 0x0012f318 in cp_parser_declaration_seq_opt (parser=0x4176e6c8) at /Users/pinskia/src/gcc-
tree-ssa/gcc/gcc/cp/parser.c:6382
#13 0x001290a4 in cp_parser_translation_unit (parser=0x4176e6c8) at /Users/pinskia/src/gcc-tree-
ssa/gcc/gcc/cp/parser.c:2383
#14 0x00140a70 in c_parse_file () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cp/parser.c:15370
#15 0x00252218 in c_common_parse_file (set_yydebug=0) at /Users/pinskia/src/gcc-tree-ssa/gcc/
gcc/c-opts.c:1234
#16 0x002ae750 in compile_file () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/toplev.c:1869
#17 0x002b47e4 in do_compile () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/toplev.c:4570
#18 0x002b48c8 in toplev_main (argc=2, argv=0xbffffca0) at /Users/pinskia/src/gcc-tree-ssa/gcc/
gcc/toplev.c:4610
#19 0x00269da0 in main (argc=2, argv=0xbffffca0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
main.c:35

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.5.0 2.95.3 3.0.4 3.3.1
                   |                            |3.2.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-02 20:21:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
  2004-03-02 20:21 ` [Bug c++/14390] " pinskia at gcc dot gnu dot org
@ 2004-03-03  3:34 ` giovannibajo at libero dot it
  2004-03-03 13:44 ` giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-03  3:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-03 03:34 -------
The code in the snippet is actually invalid because there is no definition for 
the template function you are trying to instantiate.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
  2004-03-02 20:21 ` [Bug c++/14390] " pinskia at gcc dot gnu dot org
  2004-03-03  3:34 ` giovannibajo at libero dot it
@ 2004-03-03 13:44 ` giovannibajo at libero dot it
  2004-03-03 15:18 ` bangerth at dealii dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-03 13:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-03 13:44 -------
It looks like it's a duplicate, after all.

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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-03-03 13:44 ` giovannibajo at libero dot it
@ 2004-03-03 15:18 ` bangerth at dealii dot org
  2004-03-03 17:02 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-03 15:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-03 15:18 -------
I don't know much about the internals of gcc, but the ICE clearly happens in 
a different place. So I'd like to keeo this one open for a while. If you have a patch for 
14389, we may still reevaluate whether it also fixes this one. 
 
As to the validity: the code can be made valid by adding the function definition. That doesn't 
change the ICE, though, so I removed the additional one line for the sake of brevity. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Keywords|ice-on-invalid-code         |ice-on-valid-code
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2004-03-03 15:18 ` bangerth at dealii dot org
@ 2004-03-03 17:02 ` pinskia at gcc dot gnu dot org
  2004-03-03 17:07 ` giovannibajo at libero dot it
  2004-05-03 10:16 ` giovannibajo at libero dot it
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-03 17:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-03 17:02 -------
So lets make this one depend on PR 14389 then.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |14389
             Status|REOPENED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2004-03-03 17:02 ` pinskia at gcc dot gnu dot org
@ 2004-03-03 17:07 ` giovannibajo at libero dot it
  2004-05-03 10:16 ` giovannibajo at libero dot it
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-03 17:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-03 17:07 -------
Sorry for my bad English, I should have said "it turns out" instead of "it 
looks like". My patch for 14389 does fix also this, they are affected by the 
same bug, and they excercise it in two slightly different ways so that the ICE 
appears in different places. 

You know that I don't undo work of other people just because I feel like it :)


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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/14390] ICE in tsubst with instantiation of overloaded template
  2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2004-03-03 17:07 ` giovannibajo at libero dot it
@ 2004-05-03 10:16 ` giovannibajo at libero dot it
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-05-03 10:16 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 14390 depends on bug 14389, which changed state.

Bug 14389 Summary: Out-of-line of overloaded template rejected
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14389

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14390


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-05-03 10:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02 19:51 [Bug c++/14390] New: ICE in tsubst with instantiation of overloaded template bangerth at dealii dot org
2004-03-02 20:21 ` [Bug c++/14390] " pinskia at gcc dot gnu dot org
2004-03-03  3:34 ` giovannibajo at libero dot it
2004-03-03 13:44 ` giovannibajo at libero dot it
2004-03-03 15:18 ` bangerth at dealii dot org
2004-03-03 17:02 ` pinskia at gcc dot gnu dot org
2004-03-03 17:07 ` giovannibajo at libero dot it
2004-05-03 10:16 ` giovannibajo at libero dot it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).