i386 and asm jumping

Michael Matz matzmich@cs.tu-berlin.de
Tue May 7 07:45:00 GMT 2002


Hi,

On Tue, 7 May 2002, Robert Dewar wrote:

> > It is not possible.  ASM statements may not jump.
> > You may want to use computed goto GCC extension istead.
>
> Seems a pity, this is quite a serious restriction in capability
> compared with Asm inserts in other compilers.

And how do those compare in optimizing functions containing asm's?  Sitch
it off completely?  If you can jump out of the inside of an asm, you
basically have a trapping insn.  It's target may or may not be given as a
parameter, e.g. a label.  If not, hmm, possibly it's equivalent to a
computed goto, i.e. reaches possibly all defined labels.  But that aside,
internally with non-trapping insns, only jump_insn can jump.  I wouldn't
call that a serious restriction.  If you want asm, write a .s file.


Ciao,
Michael.



More information about the Gcc mailing list