how to code global indirect branches ?

Ian Lance Taylor iant@google.com
Tue Aug 28 05:35:00 GMT 2007


"Jiayuan" <jerrygonair@hotmail.com> writes:

> Now, I need to achieve the same goal without using function calls(and
> therefore no function pointers). So, I am thinking about indirect jumps. I
> tend to define a unique code label within each kernel operator, and then I
> can pass the indirect jump's target address to the mymain function, which
> can then jump to the right instruction. But I don't know how to do it. It
> can be something like the following:

You can't do an indirect jump between functions.  That is really
impossible to implement in C++.  What happens when you goto a
function, and it returns?

gcc does have an extension for computed labels within a single
function.  Look in the documentation for "Labels as Values".

Ian



More information about the Gcc-help mailing list