[PATCH] Re: scheduling vs lexical scopes

Richard Henderson rth@redhat.com
Sat Dec 29 12:27:00 GMT 2001


On Sat, Dec 29, 2001 at 02:45:12PM -0500, Jakub Jelinek wrote:
> I've added debug-5.c because my first attempt to fix it
> fixed debug-3.c but didn't fix the original glibc ICE.

It'd be a Good Thing, I think, to check more directly for
the case you're fixing here, since Jason's patch (which I 
plan to commit) will obscure the issue.

I think this modification of debug-5.c should be about right.
Certainly it fails right now -- I've not verified that your
patch fixes it, but I suspect that it will.  Will you commit
it at the same time if so?


r~



/* Verify that bb-reorder re-inserts nested scopes properly.  */
/* { dg-do compile } */
/* { dg-options "-O3 -g -dA" } */
/* { dg-final { scan-assembler "xyzzy" } } */

extern void abort (void);

struct A { char *a, *b, *c, *d; };

static int
bar2 (struct A *x)
{
  int a = x->c - x->b;
  x->c += 26;
  return a;
}
   
void fnptr (int *);

void
foo (void)
{
  struct A e;

  if (bar2 (&e) < 0)
    abort ();
  {
    int xyzzy;
    fnptr (&xyzzy);
  }
  {
    struct A *f;
  
    f = &e;
    if (f->c - f->a > f->d - f->a)
      f->c = f->d;
  }
}



More information about the Gcc-patches mailing list