annotate gcc/testsuite/g++.dg/opt/cfg1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR optimization/11083
kono
parents:
diff changeset
2 // Origin: <nick@ilm.com>
kono
parents:
diff changeset
3 // Reduced testcase by Wolfgang Bangerth <bangerth@ticam.utexas.edu>
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // The compiler used to keep unreachable basic blocks after dead edges
kono
parents:
diff changeset
6 // had been purged, which fooled the LCM code of the GCSE pass.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 // { dg-do compile }
kono
parents:
diff changeset
9 // { dg-options "-O2 -fnon-call-exceptions" }
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 extern void *memmove (void *, const void *, unsigned int) throw ();
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 struct S {
kono
parents:
diff changeset
14 int *q;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 S(int *i) : q(i) {}
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 struct X {
kono
parents:
diff changeset
20 int *p;
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 void foo(S first, S last) {
kono
parents:
diff changeset
23 try { memmove(0, 0, last.q - first.q); }
kono
parents:
diff changeset
24 catch(...) { throw; }
kono
parents:
diff changeset
25 }
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 void bar (const X& x);
kono
parents:
diff changeset
28 };
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 void X::bar (const X& x)
kono
parents:
diff changeset
31 {
kono
parents:
diff changeset
32 const unsigned int xlen = S(x.p).q - S(x.p).q;
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 if (xlen > 0)
kono
parents:
diff changeset
35 foo(S(x.p), S(x.p));
kono
parents:
diff changeset
36 }