How to disable cc compiler optimization for a code segment?
807578Nov 4 2007 — edited Nov 7 2007Hello,
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