@@ -6862,8 +6862,7 @@ expand_omp_sections (struct omp_region *
{
/* If we are not inside a combined parallel+sections region,
call GOMP_sections_start. */
- t = build_int_cst (unsigned_type_node,
- exit_reachable ? len - 1 : len);
+ t = build_int_cst (unsigned_type_node, len - 1);
u = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_START);
stmt = gimple_build_call (u, 1, t);
}
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+__attribute__((noinline, noclone, noreturn))
+void
+foo ()
+{
+ sleep (4);
+ exit (0);
+}
+
+int
+main ()
+{
+ #pragma omp parallel
+ {
+ #pragma omp sections
+ {
+ foo ();
+ #pragma omp section
+ foo ();
+ #pragma omp section
+ foo ();
+ }
+ }
+ return 0;
+}