2015-09-24 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr45819.c
blobfb59359a708f2e57aea9538b2ccdd097700f531f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -w" } */
4 struct ehci_regs {
5 char x;
6 unsigned int port_status[0];
7 } __attribute__ ((packed));
9 struct ehci_hcd {
10 struct ehci_regs *regs;
13 int ehci_hub_control (struct ehci_hcd *ehci, int wIndex)
15 unsigned int *status_reg = &ehci->regs->port_status[wIndex];
16 return *(volatile unsigned int *)status_reg;
19 /* { dg-final { scan-tree-dump "={v}" "optimized" } } */