public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3617: ICE when optimizing templated code
@ 2001-07-09  5:36 reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: reichelt @ 2001-07-09  5:36 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3617
>Category:       c++
>Synopsis:       ICE when optimizing templated code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 09 05:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Volker Reichelt
>Release:        gcc 3.0
>Organization:
>Environment:
i686-pc-linux-gnu, mips-sgi-irix6.5
>Description:
When compiling the following lines

template <int> struct A { template <class T> static void f(T); };
template <> template <class T> void A<0>::f(T) {}
void g() { A<0>::f(1); }

with -O3 turned on I get an ICE:

In file included from SpecialBug.cpp:3:
SpecialBug.cpp:1: Internal error: Segmentation fault
Please submit a full bug report,

etc. With -O2 or less the code compiles without problems.
In addition the error message itself is a little weird:
In spite of the message there is no included file at all.

And last but not least, there is one more problem:
With g++ 2.95.3 I get the following error message:

SpecialBug.cpp:2: template parameters specified in specialization
SpecialBug.cpp:2: no `static void A<0>::f(T)' member function declared in class `A<0>'
SpecialBug.cpp: In function `static void A<0>::f<T>(T)':
SpecialBug.cpp:2: must specialize `struct A<0>' before defining member `static void A<0>::f<T>(T)'

So either my code is illegal, in which case we have an
additional accepts-illegal bug for 3.0, or the code is
legal in fact, in which case we have a rejects-legal bug
for 2.95.3.

That's about three compiler bugs for three lines of code.
Is that a new record? ;-)

Greetings, Volker
>How-To-Repeat:
g++ -O3 -c SpecialBug.cpp
>Fix:

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


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

* Re: c++/3617: ICE when optimizing templated code
@ 2002-02-01  8:23 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-01  8:23 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, reichelt

Synopsis: ICE when optimizing templated code

State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Fri Feb  1 08:23:06 2002
State-Changed-Why:
    Fixed in 3.1.
    Closed upon request of submitter.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3617


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

* Re: c++/3617: ICE when optimizing templated code
@ 2001-07-09 13:59 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2001-07-09 13:59 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, reichelt

Synopsis: ICE when optimizing templated code

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Mon Jul  9 13:59:28 2001
State-Changed-Why:
    confirmed as a bug - I think the code is well formed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3617&database=gcc


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

end of thread, other threads:[~2002-02-01 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-09  5:36 c++/3617: ICE when optimizing templated code reichelt
2001-07-09 13:59 nathan
2002-02-01  8:23 rodrigc

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).