cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

hazeman
Adept II

Possible compiler bug ( volatile qualifier )

Access to memory with volatile qualifier is optimized out by compiler ( only first access is generated to IL/ISA , following reads from the same address are removed ). 

Sample code

global volatile flot4* v;

a1 = v[0]; <- this read is generated

a2 = v[0]; <- optimized out

a3 = v[0]; <- optimized out

The standard says "The type qualifiers const, restrict, volatile as defined by the C99 specification are supported". So I think this needs to be corrected.

 

 

 

0 Likes
3 Replies

hazeman,
Thanks for reporting this, I've passed on this test case to the person who owns this.
0 Likes
paulius
Journeyman III

How do you verify that it's getting optimized out?

0 Likes

Originally posted by: paulius How do you verify that it's getting optimized out?

 

OpenCL is written on top of CAL. So it's a matter of catching calls to CAL library. Here is how http://oscarbg.blogspot.com/2009/10/cal-wrapper-for-getting-amd-il-from.html .

0 Likes