2 msgConfused at usage of stack for MIPS arch

labels in inline asm
\ Clifford Wolf (22 Nov 2007)
. \ David Daney (22 Nov 2007)

8 msgimplicit cast from unsigned long to unsigned in...
2 msgA bit field's length
2 msgwrap functions in glibc
2 msgProblems installing treelang
3 msgQuestions for GCC
2 msgbuilding gcc 4.2
2 msgUndocumented optimization flag, switched by O1
1 msgProblems building an windows toolchain using cy...
2 msgBuilding binary from code in C++...
5 msg-Wconversion bug in g++-4.3?
1 msgg++ 4.1.2 omits debug info for local symbols
1 msgld: duplicate symbol typeinfo
3 msgaliasing with char*
5 msggfortan requires old directory in LD_LIBRARY_PA...
1 msgLD_LIBRARY_PATH relation to gmp error
7 msg'error: there are no arguments to...' in my code
4 msgis it a bug or do i miss something?(about confl...
5 msgDebugging gcc-compiled programs on Windows
Subject:labels in inline asm
Group:Gcc-help
From:Clifford Wolf
Date:22 Nov 2007


Hi,

sorry for asking a probably dump question. I'm trying to port SDL_gfx
2.0.16 to ROCK Linux atm and running into a problem wich boils down to the
following test case:

--snip--
inline void foobar()
{
asm volatile(
"jz .foobar_label\n"
".foobar_label:\n"
"nop"
);
}

int main()
{
foobar();
foobar();
return 0;
}
--snap--

when compiled with optimization (inlining enabled) this sure results in an
assembler file with the .foobar_label defined three times:

# gcc -O2 -c demo.c
/tmp/ccx1Ibd9.s: Assembler messages:
/tmp/ccx1Ibd9.s:29: Error: symbol `.foobar_label' is already defined
/tmp/ccx1Ibd9.s:32: Error: symbol `.foobar_label' is already defined

maybe I'm just blind but I cant find anything in the gcc info page which
provides me with a mechanism for dynamically creating label prefixes or
something like that which would help me generating different labels in each
instances of the assembler template...

please help.

yours,
- clifford

--
When your hammer is C++, everything begins to look like a thumb.


© 2004-2008 readlist.com