This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/368: C++ 2.96 20000629: (-O1 and higher) ICE 19990828



>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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]