------- Comment #8 from jakub at gcc dot gnu dot org  2007-08-22 13:54 -------
Even shorter testcase:

/* { dg-do run } */
/* { dg-options "-O2" } */

extern void abort (void);

struct S
{
  struct S *a;
  int b;
};
#ifdef VAR
struct S t;
#endif

int
main (void)
{
  struct S *s = (struct S *) 0, **p, *n;
  for (p = &s; *p; p = &(*p)->a);
  n = (struct S *) __builtin_alloca (sizeof (*n));
  n->a = *p;
  n->b = 1;
  *p = n;

  if (!s)
    abort ();
  return 0;
}

This one behaves identically with 4.1/4.2/trunk, -O2 -UVAR -> abort,
-O2 -DVAR -> success, -O2 -fno-strict-aliasing -UVAR -> success.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33136

Reply via email to