This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/368: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/368: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
- From: harinath at cs dot umn dot edu
- Date: 1 Jul 2000 21:29:55 -0000
- Reply-To: harinath at cs dot umn dot edu
- Resent-Cc: gcc-prs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, harinath@cs.umn.edu
>Number: 368
>Category: c++
>Synopsis: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Jul 01 14:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: harinath@cs.umn.edu
>Release: gcc version 2.96 20000629 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The following file results in ICE 19990828 at -O1 and
higher optimization levels.
// ICE 19990828
struct Allocator { };
struct Event {
Event();
void *operator new(unsigned int sz, Allocator &alloc);
void operator delete(void *p, Allocator &);
};
struct State
{
Allocator &getAllocator() { return allocator_; }
Allocator allocator_;
};
void foo(State &state)
{
new (state.getAllocator()) Event();
}
>How-To-Repeat:
$ c++ -g -O1 -c test.cc
test.cc: In function `void foo (State &)':
test.cc:13: Internal compiler error 19990828.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"
Ly8gSUNFIDE5OTkwODI4CgpzdHJ1Y3QgQWxsb2NhdG9yIHsgfTsKCnN0cnVjdCBFdmVudCB7CiAg
RXZlbnQoKTsKICB2b2lkICpvcGVyYXRvciBuZXcodW5zaWduZWQgaW50IHN6LCBBbGxvY2F0b3Ig
JmFsbG9jKTsKICB2b2lkIG9wZXJhdG9yIGRlbGV0ZSh2b2lkICpwLCBBbGxvY2F0b3IgJik7Cn07
CgpzdHJ1Y3QgU3RhdGUKewogIEFsbG9jYXRvciAmZ2V0QWxsb2NhdG9yKCkgeyByZXR1cm4gYWxs
b2NhdG9yXzsgfQogIEFsbG9jYXRvciBhbGxvY2F0b3JfOwp9OwoKdm9pZCBmb28oU3RhdGUgJnN0
YXRlKQp7CiAgbmV3IChzdGF0ZS5nZXRBbGxvY2F0b3IoKSkgRXZlbnQoKTsKfQoK