diff options
author | Richard Biener <rguenther@suse.de> | 2017-09-26 07:29:51 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-09-26 07:29:51 +0000 |
commit | 09fdb7014c9b121d4f695b1ce63d13f7e43a45c8 (patch) | |
tree | f0340b9988503b0649b09dc8a759ee36ef684ec4 | |
parent | df2a1a265d13222bd4d109eeebbb7662f24fd5b1 (diff) | |
download | gcc-09fdb7014c9b121d4f695b1ce63d13f7e43a45c8.zip gcc-09fdb7014c9b121d4f695b1ce63d13f7e43a45c8.tar.gz gcc-09fdb7014c9b121d4f695b1ce63d13f7e43a45c8.tar.bz2 |
re PR tree-optimization/82320 (Compile time hog w/ -O)
2017-09-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/82320
* tree-ssa-sccvn.c (set_ssa_val_to): Changing undef to undef
isn't a change.
* gcc.dg/torture/pr82320.c: New testcase.
From-SVN: r253188
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr82320.c | 39 | ||||
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 6 |
4 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 962689b..7c6d7dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-09-26 Richard Biener <rguenther@suse.de> + + PR tree-optimization/82320 + * tree-ssa-sccvn.c (set_ssa_val_to): Changing undef to undef + isn't a change. + 2017-09-25 Jeff Law <law@redhat.com> * config/rs6000/rs6000-protos.h (output_probe_stack_range): Update diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c537ad..6401706 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-26 Richard Biener <rguenther@suse.de> + + PR tree-optimization/82320 + * gcc.dg/torture/pr82320.c: New testcase. + 2017-09-26 Christophe Lyon <christophe.lyon@linaro.org> * lib/target-supports.exp (check_effective_target_vect_hw_misalign): diff --git a/gcc/testsuite/gcc.dg/torture/pr82320.c b/gcc/testsuite/gcc.dg/torture/pr82320.c new file mode 100644 index 0000000..a4943fc --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82320.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ + +void +ec (int n4, short int ea) +{ + if (1) + { + if (ea != 0) + { + int *c1 = (int *)&ea; + +nn: + for (;;) + ++*c1; + } + } + else + { + int *lq = &n4; + int *md; + int da; + + goto nn; + +r1: + md = lq; + for (da = 0; da < 1; ++da) + { +ig: + ++n4; + *md += n4; + } + } + + for (ea = 0; ea < 1; ++ea) + goto r1; + + goto ig; +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index ca78e2d..5939749 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -3355,6 +3355,12 @@ set_ssa_val_to (tree from, tree to) if (currval != to && !operand_equal_p (currval, to, 0) + /* Different undefined SSA names are not actually different. See + PR82320 for a testcase were we'd otherwise not terminate iteration. */ + && !(TREE_CODE (currval) == SSA_NAME + && TREE_CODE (to) == SSA_NAME + && ssa_undefined_value_p (currval, false) + && ssa_undefined_value_p (to, false)) /* ??? For addresses involving volatile objects or types operand_equal_p does not reliably detect ADDR_EXPRs as equal. We know we are only getting invariant gimple addresses here, so can use |