comparison gcc/testsuite/gcc.dg/torture/pr36373-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do run } */
2 /* { dg-options "-fno-tree-sra" } */
3
4 extern void abort (void);
5 struct Bar {
6 struct Foo {
7 int *p;
8 } x;
9 int *q;
10 };
11 struct Foo __attribute__((noinline))
12 bar(int *p)
13 {
14 struct Foo f;
15 f.p = p;
16 return f;
17 }
18 void __attribute__((noinline))
19 foo(struct Foo f)
20 {
21 *f.p = 0;
22 }
23 int main()
24 {
25 int a, b;
26 a = 0;
27 b = 1;
28 struct Bar f;
29 f.x = bar (&b);
30 f.q = &a;
31 foo(f.x);
32 if (b != 0)
33 abort ();
34 return 0;
35 }