1 /* PR tree-optimization/50078 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 
5 unsigned nonvolvar[2];
6 
7 void
test(int arg)8 test (int arg)
9 {
10   unsigned v = *(volatile unsigned *) (&nonvolvar[arg]);
11   *(volatile unsigned *) (&nonvolvar[arg]) = v;
12 }
13 
14 /* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */
15