[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] asm labels
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] asm labels |
Date: |
Tue, 14 Sep 2010 23:44:37 +0200 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; ) |
Le lundi 13 septembre 2010 16:56:33, grischka a écrit :
> Thomas Preud'homme wrote:
> > Greetings everyone,
> >
> > I've just added support for asm labels for functions. The syntax is the
> > same
>
> > as in gcc:
> Well, feel free to answer this or not, but I'm just curious: Do you have
> an idea what the gcc people had in mind (if anything) when they added this
> feature? I mean, I declare "foo" but it's "bar" really? Why not declare
> it as "bar"? Or why not write "#define foo bar"? And what has this
> feature to do with asm, exactly?
>
> Anyway, as to tinycc, I noticed that it fails to compile with NOTALLINONE
> defined. So if this is not an "asm-feature" really I'd suggest to move
> the two functions "parse_asm_str" and "asm_label_instr" elsewhere (e.g.
> to libtcc.c or tccgen.c) and remove CONFIG_TCC_ASM from tccasm.c again.
> The idea is that tccasm.c can stay out from compilation on platforms
> without asm support.
Done. See commit b8adf00
>
> Cheers,
>
> --- grischka
Best regards,
Thomas Preud'homme
>
> > ==== test1.c ====
> > int foo(void) __asm__("bar");
> >
> > int main(void)
> > {
> >
> > return foo();
> >
> > }
> >
> > ==== test2.c ====
> > #include <stdio.h>
> >
> > int foo(void)
> > {
> >
> > puts("foo called);
> > return 0;
> >
> > }
> >
> > int bar(void)
> > {
> >
> > puts("bar called");
> > return 0;
> >
> > }
> >
> > and then tcc -o test test1.c test2.c && ./test will print "bar called".
> >
> > Asm label will come in another commit. Relevant commit for this change is
> > 9b09fc3
> >
> > Best regards,
> >
> > Thomas Preud'homme
signature.asc
Description: This is a digitally signed message part.