This is the mail archive of the gcc-help@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: Forcing inline assembly code to be produced


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


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