avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] Is "noreturn" attribute still not supported?


From: Ben Mann
Subject: RE: [avr-gcc-list] Is "noreturn" attribute still not supported?
Date: Mon, 24 Jan 2005 14:42:58 +0800

Perhaps a function is not what you want?

Inline functions can be compiled with different register usage according to
the compiler's whim (or so it can appear).

It sounds like you just want two labels in a function that doesn't return
and to GOTO each as required:

void main()
{
G:
        ...do stuff
        goto F; //JMP to F

F:
        ...do stuff
        goto G; //JMP to G
}

would this not suit? No registers push/pop, no stack etc. This is
effectively what you'd be coding in asm.

Ben Mann


-----Original Message-----
From: address@hidden [mailto:address@hidden
On Behalf Of Lin Gu
Sent: Monday, 24 January 2005 2:25 PM
To: address@hidden
Cc: address@hidden
Subject: Re: [avr-gcc-list] Is "noreturn" attribute still not supported?


On Sun, Jan 23, 2005 at 07:04:17PM -0500, Trampas wrote:
> When would you use the noreturn?
>
> Could you just specify function as inline?
>

I need to implement a function f() which does not
return. In another function g() I use inline assembly
code to JMP to f(). Though f() does not return,
it JMP to g() sooner or later, and g() JMP to f()     
again. Hence, if f() pushes registers, this
recursive execution will make stack overflow.

Inline functions, as far as I understand, are like
macros so they do not have their unique entry piont
where the assembly code in g() can JMP to.

lin
--
Lin Gu
University of Virginia

_______________________________________________
avr-gcc-list mailing list
address@hidden http://www.avr1.org/mailman/listinfo/avr-gcc-list





reply via email to

[Prev in Thread] Current Thread [Next in Thread]