www.digitalmars.com         C & C++   DMDScript  

c++.stl.sgi - hang with full optimization (SGI STL 3.3/dmc 8.27)

reply Marcus Elderic Koenig <elderic t-online.de> writes:
Hi there,

can anyone tell me why programs compiled with -o keep
hanging, if I use template set<>:

-SNIP-

set<float> floatcache;
float x, y, z;
				
vector<string>::iterator vecPos; 

if (temp.size() > 0) {
			
   cout << "scanning for floats... " << endl;
			
   for (vecPos = temp.begin();
	     vecPos != temp.end();
	     vecPos++) {
				 				 
	 if (sscanf(vecPos->c_str(), "v %f %f %f", &x, &y, &z) == 3) {
				 				 	
	    	floatcache.insert(x);
		floatcache.insert(y);
		floatcache.insert(z);
				 	
	 };	
			 	
   };
			
};				

-SNIP-

--------------------------------------

if I compile this program without -o,
it runs just fine and inserts all the scanned floats
into the set.

compiler: digitalmars 8.27 / SGI STL 3.3

I downloaded the SGI STL 3.2 from the homepage earlier...
in the sample code for set<>, there's a #pragma message
saying "JAK! full optimization causes hang!".

This seems to be a know bug. Is there a solution for it?

-elderic
May 21 2002
parent "Walter" <walter digitalmars.com> writes:
At the moment, there is no resolution for it, although you can try 8.28 out
on it. Also, it may not be hanging, it just may be taking a long time.


"Marcus Elderic Koenig" <elderic t-online.de> wrote in message
news:Xns9215B9C9DE6C8marcuselderickoenig 63.105.9.61...
 Hi there,

 can anyone tell me why programs compiled with -o keep
 hanging, if I use template set<>:

 -SNIP-

 set<float> floatcache;
 float x, y, z;

 vector<string>::iterator vecPos;

 if (temp.size() > 0) {

    cout << "scanning for floats... " << endl;

    for (vecPos = temp.begin();
      vecPos != temp.end();
      vecPos++) {

 if (sscanf(vecPos->c_str(), "v %f %f %f", &x, &y, &z) == 3) {

     floatcache.insert(x);
 floatcache.insert(y);
 floatcache.insert(z);

 };

    };

 };

 -SNIP-

 --------------------------------------

 if I compile this program without -o,
 it runs just fine and inserts all the scanned floats
 into the set.

 compiler: digitalmars 8.27 / SGI STL 3.3

 I downloaded the SGI STL 3.2 from the homepage earlier...
 in the sample code for set<>, there's a #pragma message
 saying "JAK! full optimization causes hang!".

 This seems to be a know bug. Is there a solution for it?

 -elderic
May 21 2002