summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr50078.c
blob: a8aee43fb6a2c400aae4ef7c5cd541b71f737e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* PR tree-optimization/50078 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

unsigned nonvolvar[2];

void
test (int arg)
{
  unsigned v = *(volatile unsigned *) (&nonvolvar[arg]);
  *(volatile unsigned *) (&nonvolvar[arg]) = v;
}

/* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */