Forcing inline assembly code to be produced
Bryce Schober
bryce.schober@dynonavionics.com
Mon Apr 23 18:36:00 GMT 2007
On 4/23/07, Kristis Makris <kristis.makris@asu.edu> wrote:
> Hello,
>
> I'm facing a problem producing inline assembly code in a C program. It
> seems that when assembly code is added in a path that seems to be
> unreachable (dead-code I suppose) the assembly code is not produced at
> all. I'm using gcc 3.3.5 and as 2.15.
>
> Is there a way to force such assembly code to be produced even though it
> may be unreachable ? If not should there be a way ?
>
> I'm attaching a simplified test case I'm using. I'm trying to generate a
> symbol with inline assembly.
>
> In a more complicated example, I'm trying to position uncommonly used
> code in a separate memory region for better cache locality. One of the
> inline assembly statements I'm using is not produced. This results in
> not changing back to the ".text" section, resulting in further assembler
> problems as described in:
>
> http://lists.gnu.org/archive/html/bug-binutils/2007-04/msg00107.html
>
> Thanks for any help.
> Kristis
>
>
The gcc docs ( http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended-Asm
) mention "asm volatile", which may help in your case, though the
language of the documentation suggests that it's not guaranteed.
--
Bryce Schober
More information about the Gcc-help
mailing list