From: Bram <stolk@xs4all.nl>
Subject: egcc + STL + optimize == crash?
Date: 1999/01/07 [thread overview]
Message-ID: <3694C91D.69663E88@xs4all.nl> (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;
}
reply other threads:[~1999-01-07 5:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox