Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

__tm_abort failure in Linux

Last post 04-15-2008, 10:34 AM by MAD\rnaraya. 2 replies.
Sort Posts: Previous Next
 04-15-2008, 1:29 AM 30252769  

__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 matter if 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 produce NO 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 <iostream>
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 "<<a<<endl;
}
 
 04-15-2008, 2:39 AM 30252772 in reply to 30252769  

Re: __tm_abort failure in Linux

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

 


Jim Cownie
(Intel Performance, Analysis and Threading Lab)
 
 04-15-2008, 10:34 AM 30252810 in reply to 30252769  

Re: __tm_abort failure in Linux

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.

 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...