public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8668: ICE 19970302 on trivial code
@ 2002-11-30 20:57 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2002-11-30 20:57 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, massimo.bombino, nobody

Synopsis: ICE 19970302 on trivial code

State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Thu Nov 21 04:17:09 2002
State-Changed-Why:
    Exact duplicate of c++/8667.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8668


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/8668: ICE 19970302 on trivial code
@ 2002-11-30 20:16 massimo.bombino
  0 siblings, 0 replies; 2+ messages in thread
From: massimo.bombino @ 2002-11-30 20:16 UTC (permalink / raw)
  To: gcc-gnats


>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 <iostream>
#include <ctime>
#include <cstdlib>
#include <memory>

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] << " <MESG_SIZ> <ITERATIONS>" << 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<n;i++)
    {
    	unsigned char Data[MESG_SIZ];
    	
        ACE_Message* Msg1(new Msg_bcpbfp_aal2d_setup_req(34, Bfp, Data));

    	// after ACE_TASK::getq()

    	BOM_BfpMessage* BfpMsg = dynamic_cast<BOM_BfpMessage*>(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;
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-21 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-30 20:57 c++/8668: ICE 19970302 on trivial code paolo
  -- strict thread matches above, loose matches on Subject: below --
2002-11-30 20:16 massimo.bombino

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).