public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-25 6:58 lerdsuwa
0 siblings, 0 replies; 7+ messages in thread
From: lerdsuwa @ 2002-06-25 6:58 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, oneill
Synopsis: Regression: ICE on C++ code involving templates and sizeof
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Tue Jun 25 06:56:40 2002
State-Changed-Why:
Confirmed. Regression from GCC 2.95.x.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7112
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-07-01 20:23 mmitchel
0 siblings, 0 replies; 7+ messages in thread
From: mmitchel @ 2002-07-01 20:23 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mmitchel, oneill
Synopsis: Regression: ICE on C++ code involving templates and sizeof
State-Changed-From-To: analyzed->closed
State-Changed-By: mmitchel
State-Changed-When: Mon Jul 1 20:23:31 2002
State-Changed-Why:
Fixed in GCC 3.1.1.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7112
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-27 14:56 mmitchel
0 siblings, 0 replies; 7+ messages in thread
From: mmitchel @ 2002-06-27 14:56 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mmitchel, nobody, oneill
Synopsis: Regression: ICE on C++ code involving templates and sizeof
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-By: mmitchel
Responsible-Changed-When: Thu Jun 27 14:50:37 2002
Responsible-Changed-Why:
Analysis.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7112
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-26 6:56 Reichelt
0 siblings, 0 replies; 7+ messages in thread
From: Reichelt @ 2002-06-26 6:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/7112; it has been noted by GNATS.
From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, oneill@cs.hmc.edu, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org
Cc:
Subject: Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
Date: Wed, 26 Jun 2002 13:17:08 +0200
Hi,
PR 7115 exposes a similar bug, see code snippet in the audit trail.
Greetings,
Volker Reichelt
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7112
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7115
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-25 12:16 M.E. O'Neill
0 siblings, 0 replies; 7+ messages in thread
From: M.E. O'Neill @ 2002-06-25 12:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/7112; it has been noted by GNATS.
From: "M.E. O'Neill" <oneill@cs.hmc.edu>
To: lerdsuwa@users.sourceforge.net
Cc: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, oneill@cs.hmc.edu,
gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
Date: Tue, 25 Jun 2002 11:07:45 -0700 (PDT)
Kriang Lerdsuwanakij writes:
> This has to do with the ABI. Mangling of 'sizeof expr' is specified
> in the ABI and implemented in GCC, but not its companion 'sizeof(type)'.
This ABI classification seems curious to me -- if I simplify the test
by changing Foobar<sizeof(Wrapper<A>)> to Foobar<sizeof(A)> everything
compiles okay.
i.e.,
template <typename A>
Foobar<sizeof(A)> *
compiler_bug (A)
{
return 0;
}
instantiated with A=int compiles as:
__Z12compiler_bugIiEP6FoobarIXszT_EET_
which demangles as:
Foobar< sizeof(int)>* compiler_bug<int>(int)
This seems to indicate that at least some of the time, name mangling
*can* represent sizeof(TYPE) [although I'm unclear why sizeof(TYPE) or
sizeof(EXPR) would be necessary anyway -- why encode sizeof(int)
symbolically when we could say (int)4, and *would* say (int)4 in other
resonably similar circumstances?]
Similarly:
template <typename A>
Foobar<sizeof(Wrapper<int>)> *
compiler_bug (A)
{
return 0;
}
compiles with the signature I'd actually expect for this code,
__Z12compiler_bugIiEP6FoobarILi1EET_
i.e. Foobar<(int)1>* compiler_bug<int>(int)
After all, sizeof() can be evaluated at compile time, so I would
expect sizeof(Wrapper<A>) and sizeof(Wrapper<int>) to both evaluate as
1 when A=int. (Perhaps there is some subtle issue I'm missing here?)
M.E.O.
P.S. I'd no idea how to check this comment into the GNATS database,
maybe I can't (?).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-25 8:56 Kriang Lerdsuwanakij
0 siblings, 0 replies; 7+ messages in thread
From: Kriang Lerdsuwanakij @ 2002-06-25 8:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/7112; it has been noted by GNATS.
From: Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, oneill@cs.hmc.edu,
gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/7112: Regression: ICE on C++ code involving templates and sizeof
Date: Tue, 25 Jun 2002 22:55:26 +0700
This has to do with the ABI. Mangling of 'sizeof expr' is specified
in the ABI and implemented in GCC, but not its companion 'sizeof(type)'.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7112
^ permalink raw reply [flat|nested] 7+ messages in thread
* c++/7112: Regression: ICE on C++ code involving templates and sizeof
@ 2002-06-24 18:26 oneill
0 siblings, 0 replies; 7+ messages in thread
From: oneill @ 2002-06-24 18:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 7112
>Category: c++
>Synopsis: Regression: ICE on C++ code involving templates and sizeof
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Mon Jun 24 17:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: M.E. O'Neill
>Release: 3.1
>Organization:
Computer Science Dept, Harvey Mudd College
>Environment:
System: SunOS turing 5.7 Generic_106541-20 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ../gcc-3.1/configure --prefix /home/oneill/gcc
>Description:
Compiler ICEs on Legal (if somewhat twisted) C++ code. The test-case
ICEs on all platforms tried (i386-redhat-linux, powerpc-apple-darwin5.5,
and sparc-sun-solaris2.7), and on versions 3.0.x, 3.1 and the 20020624
3.1.1 prerelease, although it was derived from code that only ICEd on
powerpc-apple-darwin5.5.
Problem does not occur with Red Hat's 2.96RH version or the 2.95.x series.
>How-To-Repeat:
Compile the following code:
template<int size>
struct Foobar {
// Contents irrelevant
};
template <typename A>
struct Wrapper {
// Contents irrelevant
};
template <typename A>
Foobar<sizeof(Wrapper<A>)> *
compiler_bug (A)
{
return 0;
}
int main()
{
compiler_bug(1);
}
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-07-02 3:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-25 6:58 c++/7112: Regression: ICE on C++ code involving templates and sizeof lerdsuwa
-- strict thread matches above, loose matches on Subject: below --
2002-07-01 20:23 mmitchel
2002-06-27 14:56 mmitchel
2002-06-26 6:56 Reichelt
2002-06-25 12:16 M.E. O'Neill
2002-06-25 8:56 Kriang Lerdsuwanakij
2002-06-24 18:26 oneill
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).