comparison gcc/testsuite/c-c++-common/pr51628-1.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* PR c/51628. */
2 /* { dg-do compile } */
3 /* { dg-options "-O" } */
4
5 struct pair_t
6 {
7 int x;
8 int i;
9 } __attribute__((packed, aligned (4)));
10
11 extern struct pair_t p;
12 extern int *x;
13 extern void bar (int *);
14
15 int *addr = &p.i;
16
17 int *
18 foo (void)
19 {
20 struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
21 int *p0, *p1;
22 p0 = &arr[0].i;
23 bar (p0);
24 p1 = &arr[1].i;
25 bar (p1);
26 bar (&p.i);
27 x = &p.i;
28 return &p.i;
29 }