]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Wrestrict-17.c
8061fda5985b59967bff97ae13d0a6decf036779
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Wrestrict-17.c
1 /* PR tree-optimization/85826 - ICE in gimple-ssa-warn-restruct on
2 a variable-length struct
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6 int f (int n)
7 {
8 typedef struct { int a[n]; } S;
9
10 S a;
11 __attribute__ ((noinline)) S g (void) { return a; }
12
13 a.a[0] = 1;
14 a.a[9] = 2;
15
16 S b;
17 b = g ();
18
19 return b.a[0] == 1 && b.a[9] == 2;
20 }