__tm_abort failure in Linux

__tm_abort failure in Linux

The __tm_abort instruction doesn't seem to work properly to roll back the transaction under Linux. A case is as follows(almost the same as in the previous post).

No matterif I mark foo as tm_callable or not, the output is 4. (Actually it doesn't matter if there is a foo. An "a++" will also cause the output to be 1 forever). And if I put on "if(b==0)", the compilation will simply abort because of "(0): internal error: backend signals".

The Windows version works cool here (I mean it does roll back the transaction and produceNO internal error).

Btw, I'm using gcc4.2.3 here so I added an intel_compatibility.h to get everything compiled. It basicly redefines __sync_fetch_and_add as _InterlockedExchangeAdd.

#include "intel_compatibility.h"
#include
using namespace std;
__attribute__((tm_callable))
int foo(int a){
return a+3;
}

int main(){
int a=0;
int b=0;
__tm_atomic{
a++;
a=foo(a);
// if(b==0)
__tm_abort;
}
cout<<"new a "<}
3 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

This looks to me like a compiler issue on Linux. If you compile with -g then you get the correct results... (a == 0).

This is a bug in the compiler both on Linux and Windows, we discovered this bug (conditional aborts) in the late stage of release cycle and could not get the fix into the release compiler.

登陆并发表评论。