public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* __label__ , internal compiler error:segmentation fault
@ 2009-04-29 12:21 sumanth
  2009-04-29 15:54 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: sumanth @ 2009-04-29 12:21 UTC (permalink / raw)
  To: gcc-help

Hi,
    I am encountering a segmentation fault : internal compiler error  
after running this torture case.
  

 #ifdef STACK_SIZE
#define DEPTH ((STACK_SIZE) / 512 + 1)
#else
#define DEPTH 1000
#endif

#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
x(a)
{
  __label__ xlab;
  void y(a)
    {
      if (a==0)
        goto xlab;
      y (a-1);
    }
  y (a);
 xlab:;
  return a;
}
#endif

main ()
{
#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
  if (x (DEPTH) != DEPTH)
    abort ();
#endif
  exit (0);
}

After seeing similar test cases as well, my compiler crashes because of 
__label__ xlab.
Can any one point me to solution for locally declared labels in the 
sense , any macros I should define in particular
to handle __label__.

Thanks in advance,
Sumanth
 
                               



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: __label__ , internal compiler error:segmentation fault
  2009-04-29 12:21 __label__ , internal compiler error:segmentation fault sumanth
@ 2009-04-29 15:54 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2009-04-29 15:54 UTC (permalink / raw)
  To: sumanth; +Cc: gcc-help

sumanth <sumanth.gundapneni@redpinesignals.com> writes:

> After seeing similar test cases as well, my compiler crashes because
> of __label__ xlab.

Where does the compiler crash?  That will normally tell you what is
needed.

> Can any one point me to solution for locally declared labels in the
> sense , any macros I should define in particular
> to handle __label__.

The test case you showed has to do with jumping out of a nested function
to a label in an enclosing function.  This is not something that real
code does, so it's not worth worrying about unless you really want
completeness.  Look at the docs for the nonlocal_goto and
nonlocal_goto_receiver insns.  Also TRAMPOLINE_TEMPLATE and friends.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-29 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-29 12:21 __label__ , internal compiler error:segmentation fault sumanth
2009-04-29 15:54 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).