2 msgRe: [avr-libc-dev] [bug #21623] boot.h: Use the...
2 msgbug with -fleading-underscore doubling undersco...
2 msgEvents output fail in libjava
3 msgSIMD-enabled and -lpthread incompatible?
1 msggcc-4.1-20071119 is now available
5 msgHas anyone idea/plans for GCC-4.4? No such road...
5 msgBuild failure of trunk on i686-pc-gnu-linux
2 msgEarlyclobber misunderstanding in local-alloc.c?
1 msggcc-4.3-20071116 is now available
12 msgLimits of stage3 changes
4 msgFW: matrix linking
1 msgICE in in compare_values_warnv, at tree-vrp.c:701
2 msgModulo operation in C for -ve values
2 msgHelp understanding overloaded templates
7 msgown target: combine emits invalid RTL
8 msg[LTO] LTO breaks if debug info is stripped from...
4 msgbootstrap failure with rev 130208
1 msgHandling overloaded template functions with var...

How to let GCC produce flat assembly
\ Li Wang (15 Nov 2007)
. \ Joe Buck (15 Nov 2007)
. \ Li Wang (16 Nov 2007)
. . \ Jim Wilson (16 Nov 2007)
. . \ Joe Buck (16 Nov 2007)
. . . \ Li Wang (16 Nov 2007)
. . . . \ Dave Korn (16 Nov 2007)
. . . . . \ Li Wang (16 Nov 2007)
. . . . . . \ Dave Korn (16 Nov 2007)
. . . . . \ Paul Brook (16 Nov 2007)

4 msgBuild Failure for gcc-4.3-20071109
Subject:Re: How to let GCC produce flat assembly
Group:Gcc
From:Paul Brook
Date:16 Nov 2007


On Friday 16 November 2007, Dave Korn wrote:
> On 16 November 2007 05:56, Li Wang wrote:
> > As you said, the coprocessor has no ABI to describe a stack and a
> > function interface, then inline applies. But how could I inline 'main'?
> > And I am sorry for I misuse the word 'elf assembly', what exactly I mean
> > by that is how to omit the section or any other informations helps
> > linker to organize a executable from the cc1 output. In a word, codes
> > something like the following is what I want, If possible to let cc1
> > produce such assembly? Thanks.
> >
> > movl $2, -4(%ebp)
> > movl $2, -8(%ebp)
> > movl -8(%ebp), %eax
> > addl -4(%ebp), %eax
>
> Various CPU backends (but IIRC not i386) implement a "naked" function
> attribute, which suppresses function epilogue and prologue generation. You
> could implement something like that.

__attribute__((naked)) isn't useful in that way. A side-effect of suppressing
supressing the function prologue/epiloge is that you effectively can't use C
in that function. The compiler will still generate references to the stack
frame if it feels like it. This will fail fairly rapidly as you've suppressed
the code to create that stack frame.

IMHO gcc isn't really suited to this kind of absurdly small machine
implementing a crippled subset of C. C (and most of the other langages gcc
supports) pretty much assume a machine will a stack.

Note that this doesn't mean your CPU has to have dedicated stack hardware.
Most RISC architectures don't have any specific support for this, we just
pick a register, and by convention use that as the stack pointer. If there
isn't a ABI for your target, to get to design one.

Paul


© 2004-2008 readlist.com