This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is it possible to have non-optimised block within a source file.
- To: "Janis Johnson" <janis at us dot ibm dot com>
- Subject: Re: Is it possible to have non-optimised block within a source file.
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 26 Jun 2001 16:02:40 -0700
- CC: gcc at gcc dot gnu dot org
- References: <OF589B89EE.1BE7CAB8-ON88256A77.007B5B93@LocalDomain>
"Janis Johnson" <janis@us.ibm.com> writes:
> What Richard needs is a mechanism to provide hook code that will seldom
> be executed and that, when disabled, won't result in any slowdown to the
> function containing the hook.
I notice that your suggestion below doesn't do this, because
it inserts an extra jump in the code flow.
If you're willing to allow self-modifying code, and don't want a
global variable, why not just have the equivalent of
asm ("mov %0,#0" : "r"(temp));
if (__builtin_expect (temp, 0))
...
and modify the zero byte in the assembler instruction?
--
- Geoffrey Keating <geoffk@geoffk.org>