Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to disable cc compiler optimization for a code segment?

807578Nov 4 2007 — edited Nov 7 2007
Hello,

Is there any directive to tell compiler that "don't do optimization on the specific code segment" ?

Actually, we are using openmp ( which needs -O3) to create some parallel threads, and one thread is running only prefetch instructions (sparc_prefetch_read_once) for the other threads. Since there is no computation inside, the compiler eliminate all the prefetch instructions that we inserted, I guess this is done by dead code elimination.

so is there any directive that I can use for my prefetch thread (a section), to tell compiler, not to do the optimization for this code segment?

or is there any option that can disable dead code elimination , working with -O3?

Thank you very much!

Regards,
Ray
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2007
Added on Nov 4 2007
11 comments
478 views