This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dataflow committed] Fix fwprop bitrot


Bootstrapped and tested with fwprop always enabled, fixes a bootstrap failure.

Paolo
2006-10-18  Paolo Bonzini  <bonzini@gnu.org>

	* fwprop.c (all_uses_available_at): Use DF_REF_REG.
	(forward_propagate_into): Discard artificial defs/uses.
	(pass_rtl_fwprop_addr): Add TODO_df_finish.

Index: fwprop.c
===================================================================
--- fwprop.c	(revision 117848)
+++ fwprop.c	(working copy)
@@ -551,7 +551,7 @@ all_uses_available_at (rtx def_insn, rtx
       /* If the insn uses the reg that it defines, the substitution is
          invalid.  */
       for (use = DF_INSN_USES (df, def_insn); use; use = use->next_ref)
-        if (rtx_equal_p (use->reg, def_reg))
+        if (rtx_equal_p (DF_REF_REG (use), def_reg))
           return false;
     }
   else
@@ -848,6 +848,8 @@ forward_propagate_into (struct df_ref *u
 
   if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
     return;
+  if (DF_REF_FLAGS (use) & DF_REF_ARTIFICIAL)
+    return;
 
   /* Only consider uses that have a single definition.  */
   defs = DF_REF_CHAIN (use);
@@ -857,6 +859,8 @@ forward_propagate_into (struct df_ref *u
   def = defs->ref;
   if (DF_REF_FLAGS (def) & DF_REF_READ_WRITE)
     return;
+  if (DF_REF_FLAGS (def) & DF_REF_ARTIFICIAL)
+    return;
 
   /* Do not propagate loop invariant definitions inside the loop if
      we are going to unroll.  */
@@ -1027,6 +1031,7 @@ struct tree_opt_pass pass_rtl_fwprop_add
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
+  TODO_df_finish |
   TODO_dump_func,                       /* todo_flags_finish */
   0                                     /* letter */
 };

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]