I have update the fix to this one:

diff --git a/gcc/df-core.cc b/gcc/df-core.cc
index a901b84878f..cc6383990a1 100644
--- a/gcc/df-core.cc
+++ b/gcc/df-core.cc
@@ -1437,7 +1437,16 @@ df_analyze_loop (class loop *loop)
   df_set_blocks (blocks);
   BITMAP_FREE (blocks);

-  df_analyze_1 ();
+  /* Iterate over loop's exit edges and add theirs destinations BB
+     indexes.  */
+  struct loop_exit *exit;
+  for (exit = loop->exits->next; exit->e; exit = exit->next)
+    bitmap_set_bit (df->blocks_to_analyze, exit->e->dest->index);
+
+  if (dump_file)
+    debug_bitmap_file (dump_file, df->blocks_to_analyze);
+
+  df_analyze ();
 }

I still need to validate it for x86

Best,
Claudiu

On Tue, Dec 13, 2022 at 7:38 PM Claudiu Zissulescu Ianculescu
<claz...@gmail.com> wrote:
>
> >
> > Maybe you want to iterate over the loops exit edges and include their 
> > destination block instead?
> >
>
> This is better approach, let me try it and I will be back to you.
>
> Thanks,
> Claudiu

Reply via email to