This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to disanle optimizations


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]