How to disanle optimizations

Jim Wilson wilson@specifixinc.com
Tue Feb 10 23:33:00 GMT 2004


Petar Penchev wrote:
> Sometimes I need to disable compiler's optimizations for a specific asm 
> instructions (prologue and epilogue for interrupt hadnlers ). How I can 
> do that ?

There is no way to disable optimizations across an asm.

You can inhibit many optimizations by marking an asm as volatile.  The 
compiler will assume that a volatile asm can modify any machine state, 
and thus very few optimizations will be applied to or across it.

If you need something more, you should consider writting assembly 
language instead of C code.

You might also try asking a more specific question.  Vague questions are 
hard to answer well.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list