summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr45704.c
blob: 487b30a96c03902e709e476a4507af89f502fa43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-fdump-tree-optimized" } */

struct st {
    int ptr;
};

int foo(struct st *st)
{
  int v = *(volatile int *)&st->ptr;
  return v & 0xff;
}

/* { dg-final { scan-tree-dump-times "={v}" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */