This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: label question


> 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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]