This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Q: Dead code elimination in the precense of addresses taken of local labels.
- To: "Eric W. Biederman" <ebiederm+eric at ccr dot net>
- Subject: Re: Q: Dead code elimination in the precense of addresses taken of local labels.
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 14 Mar 2000 11:49:48 -0800
- Cc: gcc at gcc dot gnu dot org
- References: <m1wvn62din.fsf@flinx.hidden>
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~