Q: Dead code elimination in the precense of addresses taken of local labels.

Richard Henderson rth@cygnus.com
Tue Mar 14 11:49:00 GMT 2000


On Tue, Mar 14, 2000 at 01:53:52AM -0600, Eric W. Biederman wrote:
> My interpretation is that since the only valid use of
> computed labels is for local gotos. 

You may also use the label in non-goto contexts like printing.

> The value should not be allowed to be passed out of a function and
> somehow a diagnostic should be raised. 

This falls over with the printing example.

> On the other hand if it is legal to pass an address of a code segment
> to a another function (perhaps for a complicated variant of a switch
> statement) then optimising out the jump target is very bad.

This is most definitely not legal.


r~


More information about the Gcc mailing list