Bug 368 - C++ 2.96 20000629: (-O1 and higher) ICE 19990828
Summary: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.96
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2000-07-01 14:36 UTC by Raja Harinath
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test.cc (181 bytes, text/x-c++ )
2003-05-21 15:16 UTC, Raja Harinath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raja Harinath 2000-07-01 14:36:00 UTC
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();
}

Release:
gcc version 2.96 20000629 (experimental)

Environment:
i686-pc-linux-gnu

How-To-Repeat:
$ c++ -g -O1 -c test.cc
test.cc: In function `void foo (State &)':
test.cc:13: Internal compiler error 19990828.
Comment 1 Martin v. Loewis 2000-07-07 01:58:34 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed as a bug
Comment 2 Martin v. Loewis 2000-07-07 08:58:34 UTC
From: loewis@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, harinath@cs.umn.edu, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/368
Date: 7 Jul 2000 08:58:34 -0000

 Synopsis: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: loewis
 State-Changed-When: Fri Jul  7 01:58:34 2000
 State-Changed-Why:
     Confirmed as a bug
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=368&database=gcc
Comment 3 Neil Booth 2001-01-20 03:16:17 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in CVS:
    bash-2.04$ g++ -g -O1 test.C -c
    bash-2.04$
Comment 4 Neil Booth 2001-01-20 11:16:17 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, harinath@cs.umn.edu, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/368
Date: 20 Jan 2001 11:16:17 -0000

 Synopsis: C++ 2.96 20000629: (-O1 and higher) ICE 19990828
 
 State-Changed-From-To: analyzed->closed
 State-Changed-By: neil
 State-Changed-When: Sat Jan 20 03:16:17 2001
 State-Changed-Why:
     Fixed in CVS:
     bash-2.04$ g++ -g -O1 test.C -c
     bash-2.04$ 
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=368&database=gcc