On Sat, Jan 30, 2021 at 10:46:17AM +0100, Jakub Jelinek via Gcc-patches wrote:
> On Sat, Jan 30, 2021 at 09:17:45AM +0100, Richard Biener wrote:
> > >The following patch fixes it, ok for trunk if it passes
> > >bootstrap/regtest?
> > 
> > Hmm, that's odd.  Who relies on deferred rescan being the default?  Finish
> > pass, via processing deferred insns also resets it back.  Or is this
> > documented somewhere?
> 
> Ifcvt clearly relies on non-deferred rescanning.
> And yes, df_finish_pass clears df->changeable_flags, but we don't do that
> for this pass anymore (removal of TODO_df_finish), as that pass didn't call
> df_analyze either.
> df_process_deferred_rescans temporarily clears DF_DEFER_INSN_RESCAN
> flag, but restores it to the previous state at the end.
> 
> So, I think we either need what I posted (which passed bootstrap/regtest
> on x86_64-linux and i686-linux), or we need to restore TODO_df_finish
> for the pass.
> Given that the pass previously did call df_analyze () only conditionally,
> not at all in many functions, and had TODO_df_finish unconditionally,
> perhaps that needs to work even if it wasn't meant to be used that way.

The following works too, can bootstrap/regtest it if you prefer it that way:

2021-01-29  Jakub Jelinek  <ja...@redhat.com>

        * config/i386/i386-features.c (remove_partial_avx_dependency): Don't
        call df_process_deferred_rescans.
        (pass_data_remove_partial_avx_dependency): Readd TODO_df_finish.

        * gcc.target/i386/20051216-1.c: New test.

--- gcc/config/i386/i386-features.c.jj  2021-01-30 10:48:09.788800773 +0100
+++ gcc/config/i386/i386-features.c     2021-01-30 11:42:35.660376111 +0100
@@ -2408,7 +2408,6 @@ remove_partial_avx_dependency (void)
        }
     }
 
-  df_process_deferred_rescans ();
   bitmap_obstack_release (NULL);
   BITMAP_FREE (convert_bbs);
 
@@ -2438,7 +2437,7 @@ const pass_data pass_data_remove_partial
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  0, /* todo_flags_finish */
+  TODO_df_finish, /* todo_flags_finish */
 };
 
 class pass_remove_partial_avx_dependency : public rtl_opt_pass
--- gcc/testsuite/gcc.target/i386/20051216-1.c.jj       2021-01-30 
11:41:15.558293070 +0100
+++ gcc/testsuite/gcc.target/i386/20051216-1.c  2021-01-30 11:41:15.558293070 
+0100
@@ -0,0 +1,5 @@
+/* PR rtl-optimization/25432 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -march=cascadelake" } */
+
+#include "../../gcc.c-torture/compile/20051216-1.c"


        Jakub

Reply via email to