http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46270
Summary: [trans-mem] internal compiler error: verify_stmts
failed
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Hello,
It seems that a throw exeception in a relaxed transaction raises an error.
$ g++ -o Game.o -c -Wall -fgnu-tm Game.cpp
Game.cpp: In function void* buildProjectSyncStepConcurrently(int, int):
Game.cpp:14:14: error: statement marked for throw in middle of block
D.8218 = std::list<std::_List_iterator<Game::BuildProject> >::begin
(&erasableBuildProjects); [in atomic]
Game.cpp:14:14: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [all] Error 1
here a small testcase:
#include <list>
class Game
{
public:
struct BuildProject
{
int posX;
};
std::list<BuildProject> buildProjects;
};
static Game game;
static std::list<std::list<Game::BuildProject>::iterator>
erasableBuildProjects;
static void *buildProjectSyncStepConcurrently(int id, int localTeam)
{
__transaction [[relaxed]] {
std::list<std::list<Game::BuildProject>::iterator>::iterator it
= erasableBuildProjects.begin();
game.buildProjects.erase( (std::list<Game::BuildProject>
::iterator) *it);
}
return 0;
}
Thanks.
Patrick Marlier.