Hi all,

Is there any way to tell the gcc compiler not to reorder/optimize certain
parts of the code.  My problem stems when I try to compile a C/C++ program
with -O3 optimizations (which is required in this project).  I have a
macro that calls this multiple times:

#define queue_store(address, value) \
 asm("list_0store $0, %0, %1" : : "r" (address), "r" (value) );


An example usage of the above assembly macro would be:

#define ExampleUse (t1, t2) \
 queue_store(addr, t1); \
 queue_store(addr, t2);

(Actually, the macro that causes the most problems have 5 parameters.)

The assembly for ExampleUse needs to be together.  What the compiler likes
to do is reorder the queue_stores into what it thinks is the best way to
allocate registers and optimize the execution.  Are there any directives I
can set within ExampleUse() or anything I can do to prevent the
reordering?

Thanks In Advance!
FL

P.S.  The above is MIPS assembly if that helps, and the list_0store is not
a standard MIPS instruction.

Reply via email to