From b1a5c719518cffabfcd81a87518d0c82ee40a3da Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 23 Oct 2018 09:36:13 +0000 Subject: [PATCH] re PR tree-optimization/87700 (Compile time hog w/ -O1) 2018-10-23 Richard Biener PR tree-optimization/87700 * tree-ssa-copy.c (set_copy_of_val): Fix change detection logic. * gcc.dg/torture/pr87700.c: New testcase. From-SVN: r265418 --- gcc/ChangeLog | 5 +++ gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.dg/torture/pr87700.c | 49 ++++++++++++++++++++++++++ gcc/tree-ssa-copy.c | 2 +- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr87700.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b334845c064..f382b209b78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-23 Richard Biener + + PR tree-optimization/87700 + * tree-ssa-copy.c (set_copy_of_val): Fix change detection logic. + 2018-10-23 Jakub Jelinek PR target/87674 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 204e41c94af..9ca348875ea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-23 Richard Biener + + PR tree-optimization/87700 + * gcc.dg/torture/pr87700.c: New testcase. + 2018-10-23 Richard Biener PR tree-optimization/87693 diff --git a/gcc/testsuite/gcc.dg/torture/pr87700.c b/gcc/testsuite/gcc.dg/torture/pr87700.c new file mode 100644 index 00000000000..3aee9a5a5d7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr87700.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ + +void +wn (int ki) +{ + int m8 = 0; + int *d6 = &ki; + + if (ki == 0) + { +ud: + for (ki = 0; ki < 1; ++ki) + for (m8 = 0; m8 < 1; ++m8) + goto ud; + + d6 = &m8; + +y8: + ++m8; + +xw: + if (ki == 0) + { + } + else + { + for (m8 = 0; m8 < 1; ++m8) + { +gt: + if (*d6 == 0) + goto y8; + } + + for (m8 = 0; m8 < 1; ++m8) + { + goto gt; + +ym: + ; + } + } + + d6 = &ki; + + goto ym; + } + + goto xw; +} diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index 0c667da2d55..b526758701c 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -155,7 +155,7 @@ set_copy_of_val (tree var, tree val) copy_of[ver].value = val; if (old != val - || (val && !operand_equal_p (old, val, 0))) + && (!old || !operand_equal_p (old, val, 0))) return true; return false; -- 2.30.2