view gcc/testsuite/gcc.dg/tree-ssa/alias-19.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-alias" } */

const static int a;

int __attribute__((noinline))
foo(int i)
{
  const int *q;
  int b;
  if (i)
    q = &a;
  else
    q = &b;
  b = 1;
  /* We should not prune a from the points-to set of q.  */
  return *q;
}

extern void abort (void);
int main()
{
  if (foo(1) != 0)
    abort ();
  return 0;
}

/* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */