From: Richard Biener Date: Mon, 27 May 2019 13:18:12 +0000 (+0000) Subject: re PR tree-optimization/90637 (ICE in vect_loop_versioning, at tree-vect-loop-manip... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6b3654a9ace038ddce90f4c671d5edb4b3479e2;p=gcc.git re PR tree-optimization/90637 (ICE in vect_loop_versioning, at tree-vect-loop-manip.c:3055) 2019-05-27 Richard Biener PR tree-optimization/90637 * tree-ssa-sink.c (statement_sink_location): Honor the computed sink location for single-uses. * gcc.dg/gomp/pr90637.c: New testcase. From-SVN: r271661 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec30909166b..a7a941e238f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-27 Richard Biener + + PR tree-optimization/90637 + * tree-ssa-sink.c (statement_sink_location): Honor the + computed sink location for single-uses. + 2019-05-27 Richard Biener PR middle-end/90610 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2884de12cc8..de157051094 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-27 Richard Biener + + PR tree-optimization/90637 + * gcc.dg/gomp/pr90637.c: New testcase. + 2019-05-27 Eric Botcazou * gnat.dg/expect2.adb: New test. diff --git a/gcc/testsuite/gcc.dg/gomp/pr90637.c b/gcc/testsuite/gcc.dg/gomp/pr90637.c new file mode 100644 index 00000000000..983e03e7574 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr90637.c @@ -0,0 +1,14 @@ +/* PR tree-optimization/90637 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp -O1 --param sink-frequency-threshold=90" } */ + +int v; + +void +foo (int c) +{ + int i; +#pragma omp for simd if (c) lastprivate (v) schedule (static, 16) + for (i = 0; i < 64; ++i) + v = i; +} diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index 77abe3aa4b6..67dc127e3fc 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -439,7 +439,10 @@ statement_sink_location (gimple *stmt, basic_block frombb, if (sinkbb == frombb) return false; - *togsi = gsi_for_stmt (use); + if (sinkbb == gimple_bb (use)) + *togsi = gsi_for_stmt (use); + else + *togsi = gsi_after_labels (sinkbb); return true; }