Closed PHHargrove closed 10 years ago
On 02/26/14 19:03:00, Paul H. Hargrove wrote:
I've tried to build on four different x86-23 (aka ia32) platforms: one each of Linux, Solaris-11, FreeBSD-9 and NetBSD-6. All four failed in the compilation (using the freshly built clang) of runtime/libupc/smp/upc_alloc.upc.c
I tried building on a CentOS 32-bit VM and can duplicate a similar failure. Made sure to run the make with -j1 and enabled a debug build.
Here are the top 10/so traceback frames.
[ 90%] Building C object tools/clang/runtime/libupc/CMakeFiles/upc.dir/smp/upc_allocg.upc.o
clang-3.4: /eng/upc/dev/gary/clang/src/llvm/lib/IR/Instructions.cpp:1084: void llvm::StoreInst::AssertO
K(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType
() && "Ptr must be a pointer to Val type!"' failed.
0 clang-3.4 0x092f4194 llvm::sys::PrintStackTrace(_IO_FILE*) + 50
1 clang-3.4 0x092f43e7
2 clang-3.4 0x092f3de4
3 0x00516400 __kernel_sigreturn + 0
4 libc.so.6 0x001506ca abort + 378
5 libc.so.6 0x00147efb
6 libc.so.6 0x00147fb6
7 clang-3.4 0x091a685f llvm::StoreInst::AssertOK() + 309
8 clang-3.4 0x091a6ba5 llvm::StoreInst::StoreInst(llvm::Value*, llvm::Value*, bool, llvm::Instruction*
) + 251
9 clang-3.4 0x088f7108
10 clang-3.4 0x0947bb83 clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(llvm::Value*, llvm::Value*,
bool, unsigned int, clang::QualType, llvm::MDNode*, bool, clang::QualType, unsigned long long) + 1141
11 clang-3.4 0x0947bdf3 clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(llvm::Value*, clang::CodeGen
::LValue, bool) + 487
[...]
Any estimate on when this might be addressed?
Related question:
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c? I tried scanning the cmake files but did't find anything that looked to me like a switch for this.
On 03/05/14 17:49:46, Paul H. Hargrove wrote:
Related question:
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c? I tried scanning the cmake files but did't find anything that looked to me like a switch for this.
See my previous reply.
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c?[...]
See my previous reply.
????
Your previous email reply dealt with issue #31 (building w/o cmake). I don't see anything there about disabling libupc in the build.
On 03/05/14 18:05:59, Paul H. Hargrove wrote:
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c?[...]
See my previous reply.
????
Your previous email reply dealt with issue #31 (building w/o cmake). I don't see anything there about disabling libupc in the build.
I'd need to double check, but I thought that I suggested that if we're building upc2c we could look into not compiling/building the runtime library (libupc), but only building/installing the header files as needed ....
On Wed, Mar 5, 2014 at 9:19 PM, gary-funck notifications@github.com wrote:
On 03/05/14 18:05:59, Paul H. Hargrove wrote:
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c?[...]
See my previous reply.
????
Your previous email reply dealt with issue #31 (building w/o cmake). I don't see anything there about disabling libupc in the build.
I'd need to double check, but I thought that I suggested that if we're building upc2c we could look into not compiling/building the runtime library (libupc), but only building/installing the header files as needed ....
Yes, I do see something along those lines now. Sorry I missed it before.
-Paul
Paul H. Hargrove PHHargrove@lbl.gov Future Technologies Group Computer and Data Sciences Department Tel: +1-510-495-2352 Lawrence Berkeley National Laboratory Fax: +1-510-486-6900
On 03/05/2014 05:49 PM, Paul H. Hargrove wrote:
Is it possible to build without libupc, specifically for the case where I only care about clang-up2c? I tried scanning the cmake files but did't find anything that looked to me like a switch for this.
There isn't a specific switch for this, but the CMake files do allow you specify which library variants to build. (i.e. packed/struct etc.) Setting this to nothing might work.
I see a fair amount of interest/effort now in the idea of building clang-upc w/o also building libupc. While I am the one who asked about this in the first place, I am not sure it will accomplish much.
The error I reported here initially is that clang was crashing building libupc on x86-32. Since it crashed trying to compile upc_alloc.upc, I really don't expect that the compiler will work on a user's UPC code either. If I am right about that, then skipping the build of libupc doesn't get us any closer to a working x86-32 build of clang-upc.
On 03/06/2014 06:26 PM, Paul H. Hargrove wrote:
I see a fair amount of interest/effort now in the idea of building clang-upc w/o also building libupc. While I am the one who asked about this in the first place, I am not sure it will accomplish much.
The error I reported here initially is that clang was crashing building libupc on x86-32. Since it crashed trying to compile upc_alloc.upc, I really don't expect that the compiler will work on a user's UPC code either. If I am right about that, then skipping the build of libupc doesn't get us any closer to a working x86-32 build of clang-upc.
clang-upc only targets x86-64. Various parts of the code that deal with sizes and alignments may need to be changed to make it work with x86-32.
clang-upc only targets x86-64. Various parts of the code that deal with sizes and alignments may need to be changed to make it work with x86-32.
Pretty sure the UPC support will never be accepted upstream if it can't support 32-bit targets.
-Paul
Hmm... clang-upc doesn't seem to be working to well on PP64 (big-endian) either:
$ clangupc upc-runtime/upc-examples/cpi/mcpi.upc $ ./a.out -n 4 PI estimated to 0.0000000 from 1000000 trials on 4 threads.
However, clang-upc2c does work on this system. So, maybe not building libupc will yield a usable clang-upc2c, even if clang-upc remains broken.
On 03/06/2014 06:57 PM, Paul H. Hargrove wrote:
Hmm... clang-upc doesn't seem to be working to well on PP64 (big-endian) either:
This is almost certainly a mismatch between the library and clang CodeGen representations of pointers-to-shared.
$ clangupc upc-runtime/upc-examples/cpi/mcpi.upc $ ./a.out -n 4 PI estimated to 0.0000000 from 1000000 trials on 4 threads.
However, clang-upc2c does work on this system. So, maybe not building libupc will yield a usable clang-upc2c, even if clang-upc remains broken.
Most likely true. Since the problem is in CodeGen instead of in ASTContext (as with the 32-bit problems) it won't affect clang-upc2c.
On 03/06/2014 06:46 PM, Paul H. Hargrove wrote:
Pretty sure the UPC support will never be accepted upstream if it can't support 32-bit targets.
Nod. It's not very hard to add support. It just wasn't a requirement for the original clangupc project.
Hmm... clang-upc doesn't seem to be working to well on PP64 (big-endian) either:
This is almost certainly a mismatch between the library and clang CodeGen representations of pointers-to-shared.
Gary had indicated in email previously that he was unsure the vaddr=first/last logic was right for big-endian. So, that would be a good place to look if somebody wants to pursue this.
I don't think first/last has anything to do with machine endian, it is only the way we lay it out in the overlaying register. E.g. for 64 bit packed first is if vaddr is in the upper portion of the register, last if it is aligned with bit lowest significant bit (or the other way around). And both machines, Intel/IBM, this layout is the same.
The library at least builds without errors now, as of 77a5f3c8ebf0a6afb1bad89e292d456ce8a764b1
Regarding 32 bit implementation, I noticed in couple of places (and I added one last week on PPC function return fix), that the code checks for packed/struct implementation by checking the size of the address field for 64. Which is now incorrect for 32-bit implementation. Maybe the best is to add a UPC flag for struct/packed pointer representation.
Branch issue-36 contains my current changes for 32-bit.
I was able to pass almost all of the tests with dbg packed/struct on 32 bit machine. The failing ones are linker related:
- 'pow' was not found in some atomic tests
- '__atomic_fetch_[add,and,or,xor]_8' are not found - missing compiler-rt library (same as
atomics problem in x86_64 struct implementation).
For these errors I need to check and updated the expected results.
- bug846.upc:9:58: error: array is too large (256 elements)
unsigned long long localsz = upc_localsizeof(shared int [256][1024][1024*THREADS]);
- bug342.upc:10:10: warning: size of field 'd' (64 bits) does not match the size of the first field in transparent union; transpar
ent_union attribute ignored [-Wignored-attributes]
double d;
- bug247.upc:5:20: error: array is too large (1090584576 elements)
shared double buff[THREADS*1065024ull];
^~~~~~~~~~~~~~~~~~
Fixed by this commit: https://github.com/Intrepid/clang-upc/commit/ff266f0b6adc2ab16142c8d5210889b9b70ae481
I've tried to build on four different x86-32 (aka IA32) platforms: one each of Linux, Solaris-11, FreeBSD-9 and NetBSD-6. All four failed in the compilation (using the freshly built clang) of runtime/libupc/smp/upc_alloc.upc.c
Of the four, Solaris produced the most usable backtrace, below. The Linux system has a nearly identical backtrace, but is missing function info for the '(anonymous namespace)' frames The *BSD systems had no stack trace.