aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-05-13 18:59:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-05-13 18:59:20 +0200
commitb37dddbc771d55d42c25edb0ef4dad663dff21e8 (patch)
treea98a3f2c207b53f57c6310b769a54c75b47423f1 /libgomp
parent098aac94ef8927e4bd24fc59919e9163057688fa (diff)
downloadgcc-b37dddbc771d55d42c25edb0ef4dad663dff21e8.zip
gcc-b37dddbc771d55d42c25edb0ef4dad663dff21e8.tar.gz
gcc-b37dddbc771d55d42c25edb0ef4dad663dff21e8.tar.bz2
re PR middle-end/66133 (Wrong-code with noreturn #pragma omp task body)
PR middle-end/66133 * omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion, make sure it is never noreturn, even when the task body does not return. (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE right before GIMPLE_OMP_RETURN. (make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont for GIMPLE_OMP_TASK. For GIMPLE_OMP_RETURN corresponding to GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit. * testsuite/libgomp.c/pr66133.c: New test. From-SVN: r223171
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c/pr66133.c35
2 files changed, 40 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 674c7c7..33ea5fb 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/66133
+ * testsuite/libgomp.c/pr66133.c: New test.
+
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* Makefile.in: Regenerated with automake-1.11.6.
diff --git a/libgomp/testsuite/libgomp.c/pr66133.c b/libgomp/testsuite/libgomp.c/pr66133.c
new file mode 100644
index 0000000..e98e5aa
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr66133.c
@@ -0,0 +1,35 @@
+/* PR middle-end/66133 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+volatile int x;
+
+__attribute__((noinline)) void
+foo (void)
+{
+ if (x == 0)
+ {
+ #pragma omp task
+ {
+ usleep (2000);
+ exit (0);
+ }
+ }
+ else
+ abort ();
+}
+
+int
+main ()
+{
+ #pragma omp parallel num_threads (2)
+ {
+ #pragma omp barrier
+ #pragma omp single
+ foo ();
+ }
+ exit (0);
+}