Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C

raw
1 // PR tree-optimization/39557
2 // invalid post-dom info leads to infinite loop
3 // { dg-do run }
4 // { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info-missed-ipa -fno-rtti -Wno-missing-profile" }
5
6 struct C
7 {
8 virtual const char *bar () const;
9 };
10
11 struct D
12 {
13 D () : d1 (0) { }
14 C *d2[4];
15 int d1;
16 inline const C & baz (int i) const { return *d2[i]; }
17 };
18
19 struct E
20 {
21 unsigned char e1[2];
22 D e2;
23 bool foo () const { return (e1[1] & 1) != 0; }
24 virtual const char *bar () const __attribute__ ((noinline));
25 };
26
27 const char *
28 C::bar () const
29 {
30 return 0;
31 }
32
33 C c;
34
35 const char *
36 E::bar () const
37 {
38 const char *e = __null;
39 if (foo () && (e = c.C::bar ()))
40 return e;
41 for (int i = 0, n = e2.d1; i < n; i++)
42 if ((e = e2.baz (i).C::bar ()))
43 return e;
44 return e;
45 }
46
47 int
48 main ()
49 {
50 E e;
51 e.bar ();
52 } // { dg-missed "file .* not found" }