diff options
author | Richard Biener <rguenther@suse.de> | 2023-03-27 15:18:41 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-03-28 15:25:01 +0200 |
commit | 2b9d76c1af189b918a9970f471e6d2e2c08f7e7d (patch) | |
tree | 5685f17e15f19ac89f91cd869b89755a267a9717 /gcc/testsuite | |
parent | e70e36cbef4f01e7d32bafe17698c3bf3e4624b8 (diff) | |
download | gcc-2b9d76c1af189b918a9970f471e6d2e2c08f7e7d.zip gcc-2b9d76c1af189b918a9970f471e6d2e2c08f7e7d.tar.gz gcc-2b9d76c1af189b918a9970f471e6d2e2c08f7e7d.tar.bz2 |
tree-optimization/107087 - missed CCP after forwprop
When forwprop simplifies the CFG the 2nd order opportunities by
exposed degenerate PHIs are not realized. The following improves
this by properly tracking executable edges and thus handling this
for non-cyclic CFGs at least.
This avoids the bogus diagnostic reported for the testcase in this PR.
PR tree-optimization/107087
* tree-ssa-forwprop.cc (pass_forwprop::execute): Track
executable regions to avoid useless work and to better
propagate degenerate PHIs.
* g++.dg/pr107087.C: New testcase.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/pr107087.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pr107087.C b/gcc/testsuite/g++.dg/pr107087.C new file mode 100644 index 0000000..3ca76b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr107087.C @@ -0,0 +1,16 @@ +// { dg-do compile } +// { dg-require-effective-target c++11 } +// { dg-options "-O2" } + +#include <vector> + +void test01() +{ + std::vector<int> v1, v2{5, 6}; + int n = 0; + std::vector<int>::iterator it = v1.insert(v1.cbegin(), n); + it = v1.insert(v1.cbegin(), 1); + it = v1.insert(v1.cbegin(), {2, 3}); + it = v1.insert(v1.cbegin(), 1, 4); + it = v1.insert(v1.cbegin(), v2.begin(), v2.end()); +} |