From aa1528b5c91bd9fee1a7de9c6ebc28eff5040afd Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Mon, 17 Jul 2017 11:38:15 +0000 Subject: [PATCH] re PR tree-optimization/81369 (ICE in generate_code_for_partition) PR target/81369 * tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to function sort_partitions_by_post_order. gcc/testsuite * gcc.dg/tree-ssa/pr81369.c: New. From-SVN: r250269 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr81369.c | 23 +++++++++++++++++++++++ gcc/tree-loop-distribution.c | 3 ++- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr81369.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 841f22616f1..1b826782150 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-17 Bin Cheng + + PR target/81369 + * tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to + function sort_partitions_by_post_order. + 2017-07-17 Bin Cheng PR tree-optimization/81374 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 68c718ed5c2..22f6fdb1810 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-07-17 Bin Cheng + + PR target/81369 + * gcc.dg/tree-ssa/pr81369.c: New. + 2017-07-17 Claudiu Zissulescu * gcc.target/arc/pr9000674901.c: New file. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c new file mode 100644 index 00000000000..b40477b0b41 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution" } */ + +typedef __PTRDIFF_TYPE__ intptr_t; +int wo; + +void +sy (long int *as) +{ + for (;;) + { + *as = wo; + while (as < (long int *) (void *) 2) + { + int *y9; + + if (wo != 0) + *y9 = (int) (intptr_t) &wo; + wo /= (wo != 0 && *y9 != 0); + ++as; + } + } +} diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 5c8f29dc36f..9363c1de683 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1997,8 +1997,9 @@ merge_dep_scc_partitions (struct graph *rdg, data->partition = NULL; } } - sort_partitions_by_post_order (pg, partitions); } + + sort_partitions_by_post_order (pg, partitions); gcc_assert (partitions->length () == (unsigned)num_sccs); free_partition_graph_vdata (pg); free_graph (pg); -- 2.30.2