- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
/usr/include/tbb/machine/linux_ia32.h(92): error: register "sp" has a fixed purpose and may not be clobbered in an asm statement
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page