Fix compilation libgomp.oacc-c-c++-common/kernels-loop.c -g
2015-07-01 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/66716
* tree-cfg.c (gimple_split_block_before_cond_jump): Split before
cond_jump, instead of split after last nondebug insn before cond_jump.
* c-c++-common/goacc/kernels-loop-g.c: New test.
* testsuite/libgomp.oacc-c-c++-common/kernels-loop-g.c: New test.
---
gcc/testsuite/c-c++-common/goacc/kernels-loop-g.c | 19 +++++++++++++++++++
gcc/tree-cfg.c | 2 +-
.../libgomp.oacc-c-c++-common/kernels-loop-g.c | 5 +++++
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/c-c++-common/goacc/kernels-loop-g.c
create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-g.c
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-additional-options "-O2" } */
+/* { dg-additional-options "-g" } */
+/* { dg-additional-options "-ftree-parallelize-loops=32" } */
+/* { dg-additional-options "-fdump-tree-parloops_oacc_kernels-all" } */
+/* { dg-additional-options "-fdump-tree-optimized" } */
+
+#include "kernels-loop.c"
+
+/* Check that only one loop is analyzed, and that it can be parallelized. */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops_oacc_kernels" } } */
+/* { dg-final { scan-tree-dump-not "FAILED:" "parloops_oacc_kernels" } } */
+
+/* Check that the loop has been split off into a function. */
+/* { dg-final { scan-tree-dump-times "(?n);; Function .*main._omp_fn.0" 1 "optimized" } } */
+
+/* { dg-final { scan-tree-dump-times "(?n)pragma omp target oacc_parallel.*num_gangs\\(32\\)" 1 "parloops_oacc_kernels" } } */
+
+/* { dg-final { cleanup-tree-dump "parloops_oacc_kernels" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
@@ -5837,7 +5837,7 @@ gimple_split_block_before_cond_jump (basic_block bb)
if (gimple_code (last) != GIMPLE_COND
&& gimple_code (last) != GIMPLE_SWITCH)
return NULL;
- gsi_prev_nondebug (&gsi);
+ gsi_prev (&gsi);
split_point = gsi_stmt (gsi);
return split_block (bb, split_point)->dest;
}
new file mode 100644
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-parallelize-loops=32" } */
+/* { dg-additional-options "-g" } */
+
+#include "kernels-loop.c"
--
1.9.1