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: latent bug in unreachable code removal?


> On Tue, Jul 17, 2001 at 02:39:36PM +0200, Jan Hubicka wrote:
> > 3) make edge from each nested function call to each such label.
> 
> Um, we already do this.  This is the stuff pertaining to
> nonlocal_goto_handler_labels.
Uhm, it seems to be weird.
In the comp-goto2 testcase:

/* A slight variation of 920501-7.c.  */

#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)
    {
      void *x = &&llab;
      if (a==-1)
	goto *x;
      if (a==0)
	goto xlab;
    llab:
      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);

I get the basic block 0 overing by the CALL_INSN to y.0
Then basic block 2 contains label "xlab":
;; Start of basic block 2, registers live: (nil)
(code_label/s 34 33 63 2 ("xlab") "" [1 uses])

but the edge is:
Successors:  1 (fallthru) 3 (ab,abcall)

to:
;; Start of basic block 3, registers live: (nil)
(code_label/s 46 41 65 10 "" "" [2 uses])

That looks like completely bogus destination.

I will try to investigate why this happends.

Honza
}
> 
> 
> r~


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