Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr104515.C

raw
1 // { dg-do compile { target c++11 } }
2 // { dg-options "-O2 -fdump-tree-lim2-details" }
3
4 using T = int;
5 struct Vec {
6 T* end;
7 };
8 void pop_back_many(Vec& v, unsigned n)
9 {
10 for (unsigned i = 0; i < n; ++i) {
11 --v.end;
12 // The end-of-object clobber prevented store motion of v
13 v.end->~T();
14 }
15 }
16
17 // { dg-final { scan-tree-dump "Executing store motion of v" "lim2" } }
18 // { dg-final { scan-tree-dump "Re-issueing dependent" "lim2" } }