Possible compiler bug ( volatile qualifier )

Discussion created by hazeman on Nov 5, 2009
Latest reply on Nov 9, 2009 by hazeman

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.