On Nov 25, 2013, at 5:15 , Pekka Jääskeläinen <[email protected]> wrote:

> Now the problem is due to the printf. It now takes a constant argument and
> lots of tests use it to print out verification data, now failing to build
> due to:
> 
> /tmp/poclLvSsKQ//program.cl:66:12: error: passing '__constant char *' to 
> parameter of type 'const char *' changes address space of pointer
>    printf("char->short conversion failed\n");
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> In LLVM 3.4 the constant strings are now LLVM IR module global constant
> AS char arrays. The current printf() works on const char* which is in
> the AS 0 (private). Perhaps we can copy the constant char type
> string to a private const char* before calling the actual printf?
> printf doesn't have to be fast as it's used for debugging/verification
> anyways.

I disabled printf for 3.4 until we have a fix. The work-around should be 
simple, since the hardware (at least on CPUs) doesn't actually have address 
spaces.

Unfortunately, this is not just about the argument to printf. Internally, 
strings are also used in a few other places (e.g. to create format strings for 
the libc printf), and this fails as well. A generic way to cast between address 
spaces would be good. Maybe one can go via intptr_t? This seems to work for 
atomics...

-erik

-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/

My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://pgp.mit.edu/.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to