diff options
author | Andrew Pinski <apinski@cavium.com> | 2017-06-30 20:40:38 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2017-06-30 13:40:38 -0700 |
commit | fb6a764dfdb74bbd0acfb7dc8d95a98286637d8a (patch) | |
tree | badd638916d579f151c94ab4bc771942166022d3 /gcc/tree-if-conv.c | |
parent | 08fb13163ce5e7dcf61c3ce898a63bb54f1b6d3d (diff) | |
download | gcc-fb6a764dfdb74bbd0acfb7dc8d95a98286637d8a.zip gcc-fb6a764dfdb74bbd0acfb7dc8d95a98286637d8a.tar.gz gcc-fb6a764dfdb74bbd0acfb7dc8d95a98286637d8a.tar.bz2 |
tree-if-conv.c (predicate_scalar_phi): Update new_stmt if fold_stmt returned true.
2017-06-30 Andrew Pinski <apinski@cavium.com>
* tree-if-conv.c (predicate_scalar_phi): Update new_stmt if
fold_stmt returned true.
2017-06-30 Andrew Pinski <apinski@cavium.com>
* gcc.dg/torture/pr81245.c: New testcase.
From-SVN: r249854
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r-- | gcc/tree-if-conv.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index b1f06a8..dbacc6e 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1853,8 +1853,11 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi) new_stmt = gimple_build_assign (res, rhs); gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT); gimple_stmt_iterator new_gsi = gsi_for_stmt (new_stmt); - fold_stmt (&new_gsi, ifcvt_follow_ssa_use_edges); - update_stmt (new_stmt); + if (fold_stmt (&new_gsi, ifcvt_follow_ssa_use_edges)) + { + new_stmt = gsi_stmt (new_gsi); + update_stmt (new_stmt); + } if (dump_file && (dump_flags & TDF_DETAILS)) { |