1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 extern const unsigned long base;
4 static inline void wreg(unsigned char val, unsigned long addr) __attribute__((always_inline));
wreg(unsigned char val,unsigned long addr)5 static inline void wreg(unsigned char val, unsigned long addr)
6 {
7    *((volatile unsigned char *) (__SIZE_TYPE__) (base + addr)) = val;
8 }
wreg_twice(void)9 void wreg_twice(void)
10 {
11    wreg(0, 42);
12    wreg(0, 42);
13 }
14 
15 /* We should not remove the second null character store to (base+42) address. */
16 /* { dg-final { scan-tree-dump-times " ={v} 0;" 2 "optimized" } }  */
17