From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30547 invoked by alias); 21 Nov 2002 12:06:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30467 invoked by uid 71); 21 Nov 2002 12:06:05 -0000 Resent-Date: 21 Nov 2002 12:06:05 -0000 Resent-Message-ID: <20021121120605.30466.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, massimo.bombino@icn.siemens.it Received: (qmail 30089 invoked by uid 61); 21 Nov 2002 12:05:04 -0000 Message-Id: <20021121120504.30086.qmail@sources.redhat.com> Date: Sat, 30 Nov 2002 20:16:00 -0000 From: massimo.bombino@icn.siemens.it Reply-To: massimo.bombino@icn.siemens.it To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8668: ICE 19970302 on trivial code X-SW-Source: 2002-11/txt/msg01211.txt.bz2 List-Id: >Number: 8668 >Category: c++ >Synopsis: ICE 19970302 on trivial code >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Thu Nov 21 04:06:05 PST 2002 >Closed-Date: >Last-Modified: >Originator: Massimo Bombino >Release: GCC 2.95.3-10 >Organization: >Environment: CygWin 1.3.15-1 WinXP R1 >Description: A trivial code generate this ICE; only few simple classes are used >How-To-Repeat: g++ -o GNUBug GNUBug.c >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="GNUBug.c" Content-Disposition: inline; filename="GNUBug.c" #include #include #include #include int MESG_SIZ; class Bfp_AllIfs { public: virtual void Msg_bcpbfp_aal2d_setup_req () = 0; }; class Bfp_Coordination : public Bfp_AllIfs { private: public: Bfp_Coordination() { #if BOM_DEBUG cout << "Costruttore Bfp_Coordination " << endl; #endif } virtual ~Bfp_Coordination() { #if BOM_DEBUG cout << "Distruttore Bfp_Coordination " << endl; #endif } void Msg_bcpbfp_aal2d_setup_req (int MsgId, unsigned char * MsgData) { int Id; unsigned char Data[MESG_SIZ]; Id=MsgId; memcpy(Data, MsgData, MESG_SIZ); #if BOM_DEBUG cout << "Bfp_Coordination.Msg_bcpbfp_aal2d_setup_req() -> " << "Id = " << id << endl; #endif } }; class ACE_Message { protected: int id; public: ACE_Message(int code) //: id(code) { #if BOM_DEBUG cout << "Costruttore ACE_Message -> " << "Id = " << id << endl; #endif } virtual ~ACE_Message() { id = -1; #if BOM_DEBUG cout << "Distruttore ACE_Message -> " << "Id = " << id << endl; #endif } }; class BOM_BfpMessage : public ACE_Message { public: Bfp_AllIfs* ImplementationPtr_; BOM_BfpMessage(int code, Bfp_AllIfs* ImplementationPtr) : ACE_Message(code), ImplementationPtr_(ImplementationPtr) { #if BOM_DEBUG cout << "Costruttore BOM_BfpMessage -> " << "Id = " << id << endl; #endif } virtual ~BOM_BfpMessage() { id = -1; #if BOM_DEBUG cout << "Distruttore BOM_BfpMessage -> " << "Id = " << id << endl; #endif } virtual void process_message() { #if BOM_DEBUG cout << "BOM_BfpMessage.process_message -> " << "Id = " << id << endl; #endif } }; class Msg_bcpbfp_aal2d_setup_req : public BOM_BfpMessage { private: unsigned char Data[MESG_SIZ]; public: Msg_bcpbfp_aal2d_setup_req(int code, Bfp_AllIfs* ImplementationPtr, unsigned char * MsgData) : BOM_BfpMessage(code, ImplementationPtr) { memcpy(Data, MsgData, MESG_SIZ); #if BOM_DEBUG cout << "Costruttore Msg_bcpbfp_aal2d_setup_req -> " << "Id = " << id << endl; #endif } virtual ~Msg_bcpbfp_aal2d_setup_req() { id = -1; #if BOM_DEBUG cout << "Distruttore Msg_bcpbfp_aal2d_setup_req -> " << "Id = " << id << endl; #endif } void process_message() { #if BOM_DEBUG cout << "Msg_bcpbfp_aal2d_setup_req->process_message()" << endl; #endif ImplementationPtr_-> Msg_bcpbfp_aal2d_setup_req(); } }; int main(int argn, char **args) { time_t t1,t2; struct tm* ts; if (argn < 3) { cout << "Usage: " << args[0] << " " << endl; return -1; } int MESG_SIZ = atoi(args[1]); long n = atol(args[2]); Bfp_AllIfs* Bfp(new Bfp_Coordination()); t1 = time(NULL); ts = localtime(&t1); cout << "Inizio: " << ts->tm_hour << ":" << ts->tm_min << ":" << ts->tm_sec << endl; for(long i=0;i(Msg1); if (BfpMsg != 0) { BfpMsg->process_message(); } else { cout << "Dynamic cast failed!" << endl; } delete Msg1; } t2 = time(NULL); ts = localtime(&t2); cout << "Fine: " << ts->tm_hour << ":" << ts->tm_min << ":" << ts->tm_sec << endl; cout << n << " messages in " << (t2-t1) << " sec. (" << (n / (t2-t1)) << " msg/sec) " << endl; return 0; }