Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* egcc + STL + optimize   ==   crash?
@ 1999-01-07  5:00 Bram
  1999-01-09  5:00 ` martin
  0 siblings, 1 reply; 2+ messages in thread
From: Bram @ 1999-01-07  5:00 UTC (permalink / raw)


Hello,


When using STL, I get crashes when compiling for alpha -O.
For intel, no problems.
Without -O, also no problems.

The problems start when putting a std::list in a std::hash_map
and compiling -O.

I checked the egcs web-page, and it's not a known-bug.
Egcs recommends sending a .ii file as bug report, but as that
one is over 300Kb, I thought it would not be the right thing to
do. (It grows so large because of all the STL).

Has anyone else experienced problems with STL and egcs?

Thanks,
         Bram

For the interested, this is the src that crashes:

/*
 * This is the minimalized code to demonstrate an
 * eledged bug in egcc when putting STL-lists in an STL-hash_map
 *
 *  compiler:
 *  g++ -v 
 *  Reading specs from /usr/lib/gcc-lib/alpha-linux/egcs-2.91.57/specs
 *  gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 *
 *  cmd line:
 *  g++ -D__STL_ASSERTIONS -Wall -ggdb -o b.out bug.cc
 *  g++ -D__STL_ASSERTIONS -Wall -ggdb -O -Wall -ggdb bug.cc
 *
 * This code crashes severly when -O compiled.
 * Sometimes it may crash so hard, that gdb starts to question itself :-)
 *
 * ACTION                                     RESULT
 * ----------------------------------------------------------
 * Target Pentium-PRO instead dec-alpha       OK
 * Disabling -O                               OK
 * Using a hash_map of vectors                OK
 * Using a hash_map of lists                  CRASH
 *
 * Bram Stolk, stolk@sidonia.xs4all.nl (work: bram@nuson.nl)
 */

// It's the combination of the list and hash_map that causes troubles

#include <vector>
#include <list>
#include <hash_map>


// Our hash data
#if 1
typedef std::list<int>   HashData;
#else
typedef std::vector<int> HashData;
#endif


struct eqint
{
  bool operator()(const int s1, int s2) const
  {
    return (s1 == s2);
  }
};


typedef std::hash_map<int, HashData, hash<int>, eqint> SectorHashMap;


int main()
{
  SectorHashMap shm;

  shm[12345];
  return 0;
}



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

* Re: egcc + STL + optimize   ==   crash?
  1999-01-07  5:00 egcc + STL + optimize == crash? Bram
@ 1999-01-09  5:00 ` martin
  0 siblings, 0 replies; 2+ messages in thread
From: martin @ 1999-01-09  5:00 UTC (permalink / raw)


In article <3694C91D.69663E88@xs4all.nl>,
	Bram <stolk@xs4all.nl> writes:
> Hello,
[segmentation fault description deleted]

The code crashes with egcs-1.1.1 on my alpha, too.
The newest snapshot egcs-2.92.34 (19990103) 
(gcc2 ss-980609 experimental) doesn't have this problem, 
so it seems to me, that this bug is eliminated.

Hope, that helps
Martin.



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

end of thread, other threads:[~1999-01-09  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-07  5:00 egcc + STL + optimize == crash? Bram
1999-01-09  5:00 ` martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox