This is the mail archive of the gcc-bugs@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]

inline asm outside functions


OS: Linux 2.4.13 i686
gcc: 2.96

It does not seem possible to define inline asm statements which specify constraints outside of a function. For example, the following code will generate an error:

__asm__ ( \
" .align 4\n" \
".globl foo\n" \
" .type foo,@function\n" \
"foo:\n" \
" movl %0, %%eax\n" \
" jmp *(%%eax)\n" \
: /* no output */ \
: "n" (offset));

The error generated is:

parse error before `:'

The hacked solution to this problem is to create a dummy function surrounding the inline asm statement.

Marc - Sitepak


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