Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/pr87436.C

raw
1 // PR c++/87436
2 // { dg-do compile { target { c++11 && size32plus } } }
3 // { dg-options "-O2 -fdump-tree-gimple" }
4
5 // Verify we don't "optimize" the ctor as copying a 384MB .rodata
6 // object into the variable. It is better to initialize it through
7 // two nested loops.
8 // { dg-final { scan-tree-dump-not "this->arr = " "gimple" } }
9
10 struct S {
11 int a = -1;
12 short b = 3;
13 int x = 0;
14 int y = 1;
15 int z = 42;
16 float f = 0.123f;
17 };
18
19 struct T { S arr[4096][4096]; };
20
21 T *
22 foo ()
23 {
24 return new T;
25 }