This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: your Debian bug report #47065
- To: Matthias Klose <doko at cs dot tu-berlin dot de>
- Subject: Re: your Debian bug report #47065
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 4 Nov 1999 13:07:23 -0800
- Cc: gcc at gcc dot gnu dot org, Tyson Dowd <trd at cs dot mu dot OZ dot AU>, 47065 at bugs dot debian dot org
- References: <14348.46404.540291.699097@bolero> <19991020182016.A6684@cs.mu.oz.au> <14369.46859.525443.620546@bolero>
On Thu, Nov 04, 1999 at 05:46:00PM +0100, Matthias Klose wrote:
> void *entry_foo_1;
> foo() {
> entry_foo_1 = && foo_1;
> return;
> foo_1:
> if (global != 42) exit(1);
> goto *entry_bar_1;
> }
> main() {
> global = 42;
> foo();
> goto *entry_foo_1;
> exit(1);
> last:
> if (global != 42) exit(1);
> exit(0);
> }
This code is desparately wrong ...
> > I have just looked this up and it appears the egcs maintainers have
> > decided to take the approach that this is not legal code, and they
> > are free to optimize away the code after the labels.
... and not merely for the reason of dead code removal.
Quoting from the gcc manual:
# You cannot use this mechanism to jump to code in a different function.
# If you do that, totally unpredictable things will happen. The best way
# to avoid this is to store the label address only in automatic variables
# and never pass it as an argument.
r~