------- Comment #2 from scovich at gmail dot com  2009-05-08 23:24 -------
Sorry to bring this back up, but I'm not sure if comments show up in a
meaningful way on closed bugs...

1. where does is it documented that inline asm can't change control flow? I
can't find it in the info pages, nor anywhere in google except this bug and
another which was also resolved-invalid with a comment that it's "clearly
commented." The docs say you can do control flow within a single asm (if your
assembler supports local labels), but the only other mention is the part that
says you can't jump between asm blocks because the compiler has no way to know
that you did it.

2. It makes sense that anything related to stack frames (ret, call) would be a
snake pit, but is there some reason why local gotos are inherently unsafe?
Unlike an asm-asm jump, the compiler knows all the places control might go (you
can only jump out once, after all), and presumably users wouldn't pass in
labels they don't intend to use. It seems like the compiler could just treat
the asm block accepting labels as a basic block containing a computed goto --
control could fall out the bottom of the block or jump any of the labels which
were passed in. 

3. Supporting local gotos would help work around the annoyance of getting
condition codes out of an asm block efficiently -- pass in the label to a
branch instruction and voila!

In any case, I'm happy to accept a, "go away," but would be extremely
interested to hear the reasons behind this limitation given that it seems so
close to working on accident.


-- 

scovich at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40078

Reply via email to