aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-30.c
blob: 7ef830d1937212d331e990db765b8182c4c26a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-fre1-details" } */

extern int posix_memalign(void **memptr,
			  __SIZE_TYPE__ alignment, __SIZE_TYPE__ size);

int foo (float *p)
{
  int res = *p;
  int *q;
  void *tem;
  if (posix_memalign (&tem, 128, 128 * sizeof (int)) != 0)
    return 0;
  q = (int *)tem;
  *q = 1;
  return res + *p;
}

/* We should be able to CSE the load from *p in the return stmt.  */

/* { dg-final { scan-tree-dump "Replaced \\\*p" "fre1" } } */
/* { dg-final { cleanup-tree-dump "fre1" } } */