This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: label question
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: label question
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 12 Apr 1999 12:25:30 +0100
- Cc: Philip Blundell <pb at nexus dot co dot uk>, egcs at cygnus dot com
- Cc: richard dot earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
> On Thu, Apr 08, 1999 at 12:28:37PM +0100, Philip Blundell wrote:
> > Given code like this:
> >
> > foo()
> > {
> > bar(&&label);
> > return;
> >
> > label:
> > printf("Hello world\n");
> > }
> >
> > is it legal for the compiler to conclude that the label is unreachable and
> > delete the instructions following it, even though its address has been taken?
>
> Absolutely.
>
> > It seems that, on ARM at least, egcs 1.1.1 doesn't exhibit this behaviour but
> > the current trunk version does and this is causing the Linux C library some
> > trouble. Is the bug in the compiler or in the library?
>
> The library. What is doing that, btw?
>
I think we should generate an error for this, rather than letting the
assembler (or linker) barf. Either it should be something like "passing
label address to non-nested function" or "Address taken of unreachable
label", depending on exactly what we think is wrong with this code.
R.