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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
I did a libgomp test run with commit f96b6328fa7 "[tree-optimization] Don't
clear ctrl-altering flag for IFN_UNIQUE" reverted, and with this patch:
...
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 0f69b335b8c..3a4403d92b1 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -93,11 +93,15 @@ can_duplicate_insn_p (gimple *g)
      The IFN_GOMP_SIMT_VOTE_ANY is currently part of such a group,
      so the same holds there, but it could be argued that the
      IFN_GOMP_SIMT_VOTE_ANY could be generated after that group,
-     in which case it could be duplicated.  */
+     in which case it could be duplicated.
+     An IFN_UNIQUE call must be duplicated as part of its group,
+     or not at all.  */
   if (is_gimple_call (g)
       && (gimple_call_internal_p (g, IFN_GOMP_SIMT_ENTER_ALLOC)
          || gimple_call_internal_p (g, IFN_GOMP_SIMT_EXIT)
-         || gimple_call_internal_p (g, IFN_GOMP_SIMT_VOTE_ANY)))
+         || gimple_call_internal_p (g, IFN_GOMP_SIMT_VOTE_ANY)
+         || (gimple_call_internal_p (g)
+             && gimple_call_internal_unique_p (g))))
     return false;

   return true;
@@ -117,8 +121,6 @@ can_duplicate_bb_no_insn_iter_p (const_basic_block bb)
       if (gimple_code (g) == GIMPLE_TRANSACTION)
        return false;

-      /* An IFN_UNIQUE call must be duplicated as part of its group,
-        or not at all.  */
       if (is_gimple_call (g)
          && gimple_call_internal_p (g)
          && gimple_call_internal_unique_p (g))
...

No issues found.

Reply via email to