AMD Logo AMD Developer Central
AMD Developer Forums
Decrease font size
Increase font size
Topic Title: Possible compiler bug ( volatile qualifier )
Topic Summary:
Created On: 11/05/2009 06:36 PM
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 11/05/2009 06:36 PM
User is offline View Users Profile Print this message

Author Icon
hazeman

Posts: 19
Joined: 09/24/2009

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.

 

 

 

 11/05/2009 06:59 PM
User is offline View Users Profile Print this message

Author Icon
MicahVillmow

Posts: 525
Joined: 02/05/2008

hazeman,
Thanks for reporting this, I've passed on this test case to the person who owns this.

-------------------------
Micah Villmow
Advanced Micro Devices Inc.
--------------------------------
The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied.

 11/09/2009 06:27 PM
User is offline View Users Profile Print this message

Author Icon
paulius

Posts: 3
Joined: 10/26/2009

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

 11/09/2009 07:29 PM
User is offline View Users Profile Print this message

Author Icon
hazeman

Posts: 19
Joined: 09/24/2009

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 .

Statistics
6123 users are registered to the AMD Developer Forums forum.
There are currently 1 users logged in.

FuseTalk Hosting Executive Plan v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.

Contact AMD | Terms and Conditions | Forum Rules | ©2009 Advanced Micro Devices, Inc. | Privacy | Trademark information