Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AJ13
New Contributor I
50 Views

TBB 3.0 Compiler Error

I get the following error when I compile a TBB program with -fPIC:

/usr/include/tbb/machine/linux_ia32.h(92): error: register "sp" has a fixed purpose and may not be clobbered in an asm statement

0 Kudos
3 Replies
Alexey_K_Intel3
Employee
50 Views

The code in question has not changed since TBB 2.0 or so. What version of (presumably) GCC doyou use?

Anyway, it seems that declaring esp as clobbered is overcautious (or even wrong); as far as I remember, it was done since the assembly code pushes to and pops from stack; but since net change is zero, everything should be fine without that. So try removing "esp" from the clobbered list of the inlined assembly code.
Alexey_K_Intel3
Employee
50 Views

I have looked over the history of changes for this part of code, and I must say it was carefully crafted to satisfy a whole lot of different versions of Intel Compiler and GCC, on Linux and Mac OS X. That includes the "esp" in clobbered list which was not there originally but added later for a reason. So knowing the exact version of the compileris very important to reproduce the behavior, and understand what could/shouldbe changed, and in what way.
AJ13
New Contributor I
50 Views

The compiler was nvcc from CUDA SDK 3.0. I was playing around with CUDA + TBB... and got this error from nvidia's compiler. I'm not going to use CUDA anymore anyways, so I don't care too much about this problem anymore.

For people who may have stumbled upon this thread, I got around this problem by cleanly separating the TBB-calling code behind an interface that nvcc would never see, and then doing separate compilation with gcc... using nvcc only for one file.