Commit fb6a764d by Andrew Pinski Committed by Andrew Pinski

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
parent 08fb1316
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 Nathan Sidwell <nathan@acm.org>
* ggc.h (empty_string): Delete.
......
2017-06-30 Andrew Pinski <apinski@cavium.com>
* gcc.dg/torture/pr81245.c: New testcase.
2017-06-30 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/Walloca-14.c: Adapt test to recognize new complaint of
......
/* { dg-options "-ffast-math" } */
/* { dg-do compile } */
/* This test used to crash the vectorizer as the ifconvert pass
used to convert the if to copysign but called update_stmt on
the old statement after calling fold_stmt. */
double sg[18];
void f(void)
{
for (int i = 0 ;i < 18;i++)
{
if (sg[i] < 0.0)
sg[i] = -1.0;
else
sg[i] = 1.0;
}
}
......@@ -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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment