CG Asserting

When compiling a particular piece of c++ code with SUN GCC for sparc system version 4.0.2, i get the following assert from CG :cg: assertion failed in file ../src/common/POINTERSETQUEUE.cc at line 225cg: CG_POINTERSETQUEUE.search: non-unique funccg: 1 errors
[286 byte] By [DH3] at [2007-11-26 9:21:20]
# 1

A bit more info..

The problem only occurs when -O2 ( or higher) are used.

Replacing the following code

void DisplayEquipAt( char* sAddr)

{

int nDots = 0;

char *s;

for( s = sAddr; *s != '\0'; s ++) if( *s == '.') nDots ++;

.

.

.

}

With:

int CountDots( const char* sAddr)

{

int nDots = 0;

for( const char* s = sAddr; *s != '\0'; s ++) if( *s == '.') nDots ++;

return nDots;

}

void DisplayEquipAt( const char* sAddr)

{

int nAddrDots = CountDots( sAddr);

.

.

.

}

DH3 at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 2
> A bit more info..two code snippets provided are not enough to reproduce the problem.Please send us a short test case.
alexey_ at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 3

Sorry, I should have said that the code replacement above stops fault from occuring.

I've been trying to produce a simplyfied test case which exhibits the fault without any luck so far.

I observed that in the first snippet of code commenting out the "nDots ++;" stops the fault.

My assumption is that something about the earlier code in the module is somehow corrupting the "state" of CG.

DH3 at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 4

> I've been trying to produce a simplyfied test case

> which exhibits the fault without any luck so far.

You can preprocess your source file with -E and send the output to us.

The other way is to debug cg with step-by-step instructions. Not sure you want to go that far.

alexey_ at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 5
Forgive my ignorance, but how do i send this rather large ( approx 1M) file to you.
DH3 at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 6
> Forgive my ignorance, but how do i send this rather> large ( approx 1M) file to you.please use gccfss-contact at sun d0t comSorry we don't have a category in bugs.sun.com yet.
alexey_ at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...
# 7
got your testcase and managed to reproduce the problem.The CR number is 6459572.We'll keep you informed and thank you for reporting the bug.
alexey_ at 2007-7-6 23:53:23 > top of Java-index,Open Source Technologies,OpenSPARC...