https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65419

--- Comment #5 from vries at gcc dot gnu.org ---
This patch fixes it, but it's a bit of a hack:
...
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 013972d..0cb73a7 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -499,6 +499,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
     return;

   /* We found the call, check whether it is suitable.  */
+  if (gimple_call_builtin_p (stmt, BUILT_IN_GOACC_DATA_END))
+    return;
   tail_recursion = false;
   func = gimple_call_fndecl (call);
   if (func
...

A better solution is to add the omp_data_arr of the corresponding
GOACC_data_start as an argument to GOACC_data_end (with '.r' fnspec).

Reply via email to