This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to disanle optimizations
- From: Jim Wilson <wilson at specifixinc dot com>
- To: ptr at melexis dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 10 Feb 2004 15:33:55 -0800
- Subject: Re: How to disanle optimizations
- References: <opr25coqk4dp9hqx@localhost>
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