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

Re: [RFC] asm goto


On Tue, Jul 28, 2009 at 4:55 AM, Richard Henderson<rth@redhat.com> wrote:
> On 07/27/2009 07:44 PM, Chris Lattner wrote:
>> How does this affect the CFG? The compiler has to assume an abnormal
>> edge coming out of the asm?

<snipe> I thought Apple people were not allowed to read gcc mailing
lists? :-P </snipe>

> Nope, the compiler has a normal edge coming out. ?And since
> it can manipulate the vector of labels attached to the asm, it
> can easily redirect the label if it wants to, e.g., split a
> critical edge.

Silly question perhaps -- I don't even know if asm works with ObjC too
-- but if the extension also applies to ObjC, then how does it
interact with ObjC exceptions?



>> One nice thing about the "asm goto" approach is that you'll probably get
>> a more obvious diagnostic out of a compiler that doesn't support this
>> extension.
>
> Meh.
>
> void f1(void) { bar: asm goto("" : : : : bar); }
> void f2(void) { foo: asm ("" : : : : foo); }
>
> zz.c: In function ‘f1’:
> zz.c:1: error: expected ‘(’ before ‘goto’
> zz.c:1: error: expected identifier or ‘*’ before ‘(’ token
> zz.c: In function ‘f2’:
> zz.c:2: error: expected string literal before ‘:’ token
>
> With gcc 4.4, the messages are sort of equally bad.

FWIW, I also don't like how the goto keyword gets reused this way.

Ciao!
Steven


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