From 3072d4ea29f3b6b8b1708bd74428db307ee4976e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 25 May 2016 11:49:03 +0000 Subject: [PATCH] re PR tree-optimization/71261 (Trunk GCC hangs on knl and broadwell targets) 2016-05-25 Richard Biener PR tree-optimization/71261 * tree-if-conv.c (ifcvt_split_def_stmt): Walk uses on the interesting stmt instead of immediate uses when looking for the use operand to replace. * c-c++-common/torture/pr71261.c: New testcase. From-SVN: r236701 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/torture/pr71261.c | 11 +++++++++++ gcc/tree-if-conv.c | 6 +++--- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/torture/pr71261.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 937fc3ed092..aca886c90cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-05-25 Richard Biener + + PR tree-optimization/71261 + * tree-if-conv.c (ifcvt_split_def_stmt): Walk uses on the + interesting stmt instead of immediate uses when looking + for the use operand to replace. + 2016-05-25 Martin Liska * ipa-inline.c (edge_badness): Use 'w/' instead of 'w'. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 897f0f03e50..abdfdd81baa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-25 Richard Biener + + PR tree-optimization/71261 + * c-c++-common/torture/pr71261.c: New testcase. + 2016-05-25 Richard Biener PR tree-optimization/71264 diff --git a/gcc/testsuite/c-c++-common/torture/pr71261.c b/gcc/testsuite/c-c++-common/torture/pr71261.c new file mode 100644 index 00000000000..7290368706f --- /dev/null +++ b/gcc/testsuite/c-c++-common/torture/pr71261.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */ + +extern int a, b, c, d, e, f; +void fn1() +{ + for (int g = 0; g < d; g = 1) + for (int h = 0; h < 8; h = h + 2) + for (int i = h; i < h + 2; i = i + 1) + f = a && e || c && b; +} diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index fa0cae6fdde..5914a785ae8 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -2529,7 +2529,7 @@ ifcvt_split_def_stmt (gimple *def_stmt, gimple *use_stmt) gimple *copy_stmt; gimple_stmt_iterator gsi; use_operand_p use_p; - imm_use_iterator imm_iter; + ssa_op_iter iter; var = gimple_assign_lhs (def_stmt); copy_stmt = gimple_copy (def_stmt); @@ -2548,9 +2548,9 @@ ifcvt_split_def_stmt (gimple *def_stmt, gimple *use_stmt) print_generic_expr (dump_file, lhs, TDF_SLIM); fprintf (dump_file, "\n"); } - FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var) + FOR_EACH_SSA_USE_OPERAND (use_p, use_stmt, iter, SSA_OP_USE) { - if (USE_STMT (use_p) != use_stmt) + if (USE_FROM_PTR (use_p) != var) continue; SET_USE (use_p, lhs); break; -- 2.30.2