Open Quuxplusone opened 10 years ago
Attached file_20135.txt
(891 bytes, text/plain): preprocessed source & associated run script
I had already noticed this when playing with address spaces when targeting the
nvptx backend. Looking at the .ll file compiled using the input .c file, I can
see:
store i8 addrspace(1)* addrspacecast (i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0) to i8 addrspace(1)*), i8 addrspace(1)** %p, align 8
The assert error in C++ comes from the fact that the value being stored has
type i8* without addrspace(1) specified.
The addspacecast make it possible to skip the failing assert that we instead
get in C++ compilation. Somehow, the addrspacecast call is not performed when
compiling in C++.
file_20135.txt
(891 bytes, text/plain)