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]

RTL sharing checker update


Mark,
I re-run the testing on mainline with two additional fixes applied:

http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01441.html
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg02097.html

The first is sort of hack and I don't think it is possible to fix the
problem nicely without substantial rewrite of the pass that is desirable
(using new dataflow) but I don't have time for it at the very moment.
Since regrename is late pass, one option would be to first relax
checking, but Kenny already mentioned me, that regrename is causing real
ICEs even without the checker, so perhaps the two extra copy_rtxes are
not bad way around.

The other by Richard Standifold actually fix pretty important problem of
new dataflow implementation.

I tested on i686-linux, x86_64-linux, ia64-linux, ppc-linux and
ppc64-linux.  PPC64 linux bootstrap is currently broken, other
bootstraps/regtests passed.  Concerning the compile time costs, I think
the difference is not too high.  On GCC modules, the tester reports
increase from 11m20s to roughly 11m24s.

The aforementioned fixes are not needed for bootstrap, just for some
regressions in the testsuite.

Concerning the other primary platforms:
    * arm-eabi                                                                                                                                               
    * i386-unknown-freebsd
    * i686-apple-darwin                                                                                                                                      
    * mipsisa64-elf                                                                                                                                          
    * sparc-sun-solaris2.10     

i386-unknown-freebsd, i686-apple-darwin, mipsisa64-elf was reported to
work earlier last week and I don't think sharing situation is getting worse.
I don't have access to sparc-sun-solaris2.10/arm-eabi for bootstrapping.

I am attaching the combined patch and will give a try to PPC64 testing
once tree is back in working condition.  I wonder what else shall I do
(well, except for providing patch with full changelog of course ;)

Honza

Index: regrename.c
===================================================================
--- regrename.c	(revision 126286)
+++ regrename.c	(working copy)
@@ -823,7 +823,7 @@ build_def_use (basic_block bb)
 		    OP_IN, 0);
 
 	  for (i = 0; i < recog_data.n_dups; i++)
-	    *recog_data.dup_loc[i] = old_dups[i];
+	    *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
 	  for (i = 0; i < n_ops; i++)
 	    *recog_data.operand_loc[i] = old_operands[i];
 
@@ -1745,7 +1745,7 @@ copyprop_hardreg_forward_1 (basic_block 
 	      recog_data.operand[i] = new;
 	      for (j = 0; j < recog_data.n_dups; j++)
 		if (recog_data.dup_num[j] == i)
-		  validate_change (insn, recog_data.dup_loc[j], new, 1);
+		  validate_change (insn, recog_data.dup_loc[j], copy_rtx (new), 1);
 
 	      any_replacements = true;
 	    }
@@ -1960,7 +1960,7 @@ struct tree_opt_pass pass_regrename =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   'n'                                   /* letter */
 };
@@ -1993,7 +1993,7 @@ struct tree_opt_pass pass_cprop_hardreg 
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'n'                                   /* letter */
 };
 
Index: fwprop.c
===================================================================
--- fwprop.c	(revision 126286)
+++ fwprop.c	(working copy)
@@ -1000,7 +1000,7 @@ struct tree_opt_pass pass_rtl_fwprop =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   0                                     /* letter */
 };
@@ -1042,7 +1042,7 @@ struct tree_opt_pass pass_rtl_fwprop_add
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   0                                     /* letter */
 };
Index: see.c
===================================================================
--- see.c	(revision 126286)
+++ see.c	(working copy)
@@ -3837,7 +3837,7 @@ struct tree_opt_pass pass_see =
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,			/* todo_flags_finish */
   'u'					/* letter */
 };
Index: tracer.c
===================================================================
--- tracer.c	(revision 126286)
+++ tracer.c	(working copy)
@@ -411,7 +411,7 @@ struct tree_opt_pass pass_tracer =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'T'                                   /* letter */
 };
 
Index: postreload-gcse.c
===================================================================
--- postreload-gcse.c	(revision 126286)
+++ postreload-gcse.c	(working copy)
@@ -1322,8 +1322,8 @@ struct tree_opt_pass pass_gcse2 =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func |
-  TODO_verify_flow | TODO_ggc_collect,  /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing
+  | TODO_verify_flow | TODO_ggc_collect,/* todo_flags_finish */
   'J'                                   /* letter */
 };
 
Index: postreload.c
===================================================================
--- postreload.c	(revision 126286)
+++ postreload.c	(working copy)
@@ -1599,7 +1599,7 @@ struct tree_opt_pass pass_postreload_cse
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   'o'                                   /* letter */
 };
Index: tree-pass.h
===================================================================
--- tree-pass.h	(revision 126286)
+++ tree-pass.h	(working copy)
@@ -171,6 +171,7 @@ struct dump_file_info
 #define TODO_dump_cgraph		(1 << 7)
 #define TODO_remove_functions		(1 << 8)
 #define TODO_rebuild_frequencies	(1 << 9)
+#define TODO_verify_rtl_sharing         (1 << 10)
 
 /* To-do flags for calls to update_ssa.  */
 
@@ -182,13 +183,13 @@ struct dump_file_info
    in blocks that have one or more edges with no incoming definition
    for O_j.  This would lead to uninitialized warnings for O_j's
    symbol.  */
-#define TODO_update_ssa			(1 << 10)
+#define TODO_update_ssa			(1 << 11)
 
 /* Update the SSA form without inserting any new PHI nodes at all.
    This is used by passes that have either inserted all the PHI nodes
    themselves or passes that need only to patch use-def and def-def
    chains for virtuals (e.g., DCE).  */
-#define TODO_update_ssa_no_phi		(1 << 11)
+#define TODO_update_ssa_no_phi		(1 << 12)
 
 /* Insert PHI nodes everywhere they are needed.  No pruning of the
    IDF is done.  This is used by passes that need the PHI nodes for
@@ -199,7 +200,7 @@ struct dump_file_info
    may be doing something wrong.  Inserting PHI nodes for an old name
    where not all edges carry a new replacement may lead to silent
    codegen errors or spurious uninitialized warnings.  */
-#define TODO_update_ssa_full_phi	(1 << 12)
+#define TODO_update_ssa_full_phi	(1 << 13)
 
 /* Passes that update the SSA form on their own may want to delegate
    the updating of virtual names to the generic updater.  Since FUD
@@ -207,24 +208,24 @@ struct dump_file_info
    to do.  NOTE: If this flag is used, any OLD->NEW mappings for real
    names are explicitly destroyed and only the symbols marked for
    renaming are processed.  */
-#define TODO_update_ssa_only_virtuals	(1 << 13)
+#define TODO_update_ssa_only_virtuals	(1 << 14)
 
 /* Some passes leave unused local variables that can be removed from
    cfun->unexpanded_var_list.  This reduces the size of dump files and
    the memory footprint for VAR_DECLs.  */
-#define TODO_remove_unused_locals	(1 << 14)
+#define TODO_remove_unused_locals	(1 << 15)
 
 /* Internally used for the first in a sequence of passes.  It is set
    for the passes that are handed to register_dump_files.  */
-#define TODO_set_props			(1 << 15)
+#define TODO_set_props			(1 << 16)
 
 /* Call df_finish at the end of the pass.  This is done after all of
    the dumpers have been allowed to run so that they have access to
    the instance before it is destroyed.  */
-#define TODO_df_finish                  (1 << 16)
+#define TODO_df_finish                  (1 << 17)
 
 /* Internally used for the first instance of a pass.  */
-#define TODO_mark_first_instance	(1 << 17)
+#define TODO_mark_first_instance	(1 << 18)
 
 #define TODO_update_ssa_any		\
     (TODO_update_ssa			\
Index: df-scan.c
===================================================================
--- df-scan.c	(revision 126286)
+++ df-scan.c	(working copy)
@@ -2627,7 +2627,6 @@ df_ref_record (struct df_collection_rec 
 	       enum df_ref_type ref_type, 
 	       enum df_ref_flags ref_flags) 
 {
-  rtx oldreg = reg;
   unsigned int regno;
 
   gcc_assert (REG_P (reg) || GET_CODE (reg) == SUBREG);
@@ -2658,7 +2657,7 @@ df_ref_record (struct df_collection_rec 
 	{
 	  /* Sets to a subreg of a multiword register are partial. 
 	     Sets to a non-subreg of a multiword register are not.  */
-	  if (GET_CODE (oldreg) == SUBREG)
+	  if (GET_CODE (reg) == SUBREG)
 	    ref_flags |= DF_REF_PARTIAL;
 	  ref_flags |= DF_REF_MW_HARDREG;
 
@@ -2666,7 +2665,6 @@ df_ref_record (struct df_collection_rec 
 	  hardreg->type = ref_type;
 	  hardreg->flags = ref_flags;
 	  hardreg->mw_reg = reg;
-	  hardreg->loc = loc;
 	  hardreg->start_regno = regno;
 	  hardreg->end_regno = endregno - 1;
 	  hardreg->mw_order = df->ref_order++;
Index: mode-switching.c
===================================================================
--- mode-switching.c	(revision 126286)
+++ mode-switching.c	(working copy)
@@ -745,7 +745,7 @@ struct tree_opt_pass pass_mode_switching
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   0                                     /* letter */
 };
Index: modulo-sched.c
===================================================================
--- modulo-sched.c	(revision 126286)
+++ modulo-sched.c	(working copy)
@@ -2505,7 +2505,7 @@ struct tree_opt_pass pass_sms =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   TODO_dump_func,                       /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'm'                                   /* letter */
Index: cse.c
===================================================================
--- cse.c	(revision 126286)
+++ cse.c	(working copy)
@@ -7012,7 +7012,7 @@ struct tree_opt_pass pass_cse =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect |
   TODO_verify_flow,                     /* todo_flags_finish */
@@ -7070,7 +7070,7 @@ struct tree_opt_pass pass_cse2 =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect |
   TODO_verify_flow,                     /* todo_flags_finish */
Index: web.c
===================================================================
--- web.c	(revision 126286)
+++ web.c	(working copy)
@@ -385,7 +385,7 @@ struct tree_opt_pass pass_web =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish | 
+  TODO_df_finish | TODO_verify_rtl_sharing | 
   TODO_dump_func,                       /* todo_flags_finish */
   'Z'                                   /* letter */
 };
Index: loop-init.c
===================================================================
--- loop-init.c	(revision 126286)
+++ loop-init.c	(working copy)
@@ -186,7 +186,7 @@ struct tree_opt_pass pass_rtl_loop_init 
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'L'                                   /* letter */
 };
 
@@ -219,7 +219,7 @@ struct tree_opt_pass pass_rtl_loop_done 
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'L'                                   /* letter */
 };
 
@@ -252,7 +252,7 @@ struct tree_opt_pass pass_rtl_move_loop_
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */ 
-  TODO_df_finish |                      /* This is shutting down the instance in loop_invariant.c  */
+  TODO_df_finish | TODO_verify_rtl_sharing |                      /* This is shutting down the instance in loop_invariant.c  */
   TODO_dump_func,                       /* todo_flags_finish */
   'L'                                   /* letter */
 };
@@ -286,7 +286,7 @@ struct tree_opt_pass pass_rtl_unswitch =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'L'                                   /* letter */
 };
 
@@ -332,7 +332,7 @@ struct tree_opt_pass pass_rtl_unroll_and
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'L'                                   /* letter */
 };
 
@@ -371,7 +371,7 @@ struct tree_opt_pass pass_rtl_doloop =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   'L'                                   /* letter */
 };
 
Index: global.c
===================================================================
--- global.c	(revision 126286)
+++ global.c	(working copy)
@@ -2109,8 +2109,8 @@ struct tree_opt_pass pass_global_alloc =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func |
-  TODO_ggc_collect,                     /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing
+  | TODO_ggc_collect,                   /* todo_flags_finish */
   'g'                                   /* letter */
 };
 
Index: ifcvt.c
===================================================================
--- ifcvt.c	(revision 126286)
+++ ifcvt.c	(working copy)
@@ -4088,7 +4088,7 @@ struct tree_opt_pass pass_rtl_ifcvt =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   'C'                                   /* letter */
 };
@@ -4124,7 +4124,7 @@ struct tree_opt_pass pass_if_after_combi
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'C'                                   /* letter */
@@ -4158,7 +4158,7 @@ struct tree_opt_pass pass_if_after_reloa
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'E'                                   /* letter */
Index: recog.c
===================================================================
--- recog.c	(revision 126286)
+++ recog.c	(working copy)
@@ -3333,7 +3333,7 @@ struct tree_opt_pass pass_peephole2 =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func,                       /* todo_flags_finish */
   'z'                                   /* letter */
 };
@@ -3494,7 +3494,7 @@ struct tree_opt_pass pass_split_for_shor
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   0                                     /* letter */
 };
 
Index: dse.c
===================================================================
--- dse.c	(revision 126286)
+++ dse.c	(working copy)
@@ -3082,7 +3082,7 @@ struct tree_opt_pass pass_rtl_dse1 =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'w'                                   /* letter */
 };
@@ -3101,7 +3101,7 @@ struct tree_opt_pass pass_rtl_dse2 =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'w'                                   /* letter */
 };
Index: regmove.c
===================================================================
--- regmove.c	(revision 126286)
+++ regmove.c	(working copy)
@@ -2122,7 +2122,7 @@ struct tree_opt_pass pass_regmove =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'N'                                   /* letter */
Index: function.c
===================================================================
--- function.c	(revision 126286)
+++ function.c	(working copy)
@@ -5500,7 +5500,7 @@ struct tree_opt_pass pass_thread_prologu
   0,                                    /* properties_destroyed */
   TODO_verify_flow,                     /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'w'                                   /* letter */
 };
Index: df.h
===================================================================
--- df.h	(revision 126286)
+++ df.h	(working copy)
@@ -312,7 +312,6 @@ struct dataflow
 struct df_mw_hardreg
 {
   rtx mw_reg;                   /* The multiword hardreg.  */ 
-  rtx *loc;			/* The location of the reg.  */
   enum df_ref_type type;        /* Used to see if the ref is read or write.  */
   enum df_ref_flags flags;	/* Various flags.  */
   unsigned int start_regno;     /* First word of the multi word subreg.  */
Index: gcse.c
===================================================================
--- gcse.c	(revision 126286)
+++ gcse.c	(working copy)
@@ -6742,7 +6742,7 @@ struct tree_opt_pass pass_gcse =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_verify_flow | TODO_ggc_collect,  /* todo_flags_finish */
   'G'                                   /* letter */
Index: rtl-factoring.c
===================================================================
--- rtl-factoring.c	(revision 126286)
+++ rtl-factoring.c	(working copy)
@@ -1427,7 +1427,7 @@ struct tree_opt_pass pass_rtl_seqabstr =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'Q'                                   /* letter */
Index: lower-subreg.c
===================================================================
--- lower-subreg.c	(revision 126286)
+++ lower-subreg.c	(working copy)
@@ -1293,7 +1293,7 @@ struct tree_opt_pass pass_lower_subreg2 
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect |
   TODO_verify_flow,                     /* todo_flags_finish */
Index: bt-load.c
===================================================================
--- bt-load.c	(revision 126286)
+++ bt-load.c	(working copy)
@@ -1520,6 +1520,7 @@ struct tree_opt_pass pass_branch_target_
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
+  TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'd'                                   /* letter */
 };
Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 126286)
+++ emit-rtl.c	(working copy)
@@ -2194,7 +2194,7 @@ struct tree_opt_pass pass_unshare_all_rt
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */
   0                                     /* letter */
 };
 
Index: cfgcleanup.c
===================================================================
--- cfgcleanup.c	(revision 126286)
+++ cfgcleanup.c	(working copy)
@@ -2282,7 +2282,6 @@ struct tree_opt_pass pass_jump =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   TODO_ggc_collect,                     /* todo_flags_start */
-  TODO_dump_func |
   TODO_verify_flow,                     /* todo_flags_finish */
   'i'                                   /* letter */
 };
@@ -2313,7 +2312,7 @@ struct tree_opt_pass pass_jump2 =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   TODO_ggc_collect,                     /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */
   'j'                                   /* letter */
 };
 
Index: combine.c
===================================================================
--- combine.c	(revision 126286)
+++ combine.c	(working copy)
@@ -12931,7 +12931,7 @@ struct tree_opt_pass pass_combine =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'c'                                   /* letter */
 };
Index: bb-reorder.c
===================================================================
--- bb-reorder.c	(revision 126286)
+++ bb-reorder.c	(working copy)
@@ -2085,7 +2085,7 @@ struct tree_opt_pass pass_duplicate_comp
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */
   0                                     /* letter */
 };
 
@@ -2235,7 +2235,7 @@ struct tree_opt_pass pass_reorder_blocks
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */
   'B'                                   /* letter */
 };
 
@@ -2275,7 +2275,7 @@ struct tree_opt_pass pass_partition_bloc
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */
   0                                     /* letter */
 };
 
Index: var-tracking.c
===================================================================
--- var-tracking.c	(revision 126286)
+++ var-tracking.c	(working copy)
@@ -3006,7 +3006,7 @@ struct tree_opt_pass pass_variable_track
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */
   'V'                                   /* letter */
 };
 
Index: df-problems.c
===================================================================
--- df-problems.c	(revision 126286)
+++ df-problems.c	(working copy)
@@ -3717,6 +3717,32 @@ df_set_note (enum reg_note note_type, rt
   return old;
 }
 
+/* A subroutine of df_set_unused_notes_for_mw, with a selection of its
+   arguments.  Return true if the register value described by MWS's
+   mw_reg is known to be completely unused, and if mw_reg can therefore
+   be used in a REG_UNUSED note.  */
+
+static bool
+df_whole_mw_reg_unused_p (struct df_mw_hardreg *mws,
+			  bitmap live, bitmap artificial_uses)
+{
+  unsigned int r;
+
+  /* If MWS describes a partial reference, create REG_UNUSED notes for
+     individual hard registers.  */
+  if (mws->flags & DF_REF_PARTIAL)
+    return false;
+
+  /* Likewise if some part of the register is used.  */
+  for (r = mws->start_regno; r <= mws->end_regno; r++)
+    if (bitmap_bit_p (live, r)
+	|| bitmap_bit_p (artificial_uses, r))
+      return false;
+
+  gcc_assert (REG_P (mws->mw_reg));
+  return true;
+}
+
 /* Set the REG_UNUSED notes for the multiword hardreg defs in INSN
    based on the bits in LIVE.  Do not generate notes for registers in
    artificial uses.  DO_NOT_GEN is updated so that REG_DEAD notes are
@@ -3729,7 +3755,6 @@ df_set_unused_notes_for_mw (rtx insn, rt
 			    bitmap live, bitmap do_not_gen, 
 			    bitmap artificial_uses)
 {
-  bool all_dead = true;
   unsigned int r;
   
 #ifdef REG_DEAD_DEBUGGING
@@ -3737,18 +3762,11 @@ df_set_unused_notes_for_mw (rtx insn, rt
     fprintf (dump_file, "mw_set_unused looking at mws[%d..%d]\n", 
 	     mws->start_regno, mws->end_regno);
 #endif
-  for (r=mws->start_regno; r <= mws->end_regno; r++)
-    if ((bitmap_bit_p (live, r))
-	|| bitmap_bit_p (artificial_uses, r))
-      {
-	all_dead = false;
-	break;
-      }
-  
-  if (all_dead)
+
+  if (df_whole_mw_reg_unused_p (mws, live, artificial_uses))
     {
       unsigned int regno = mws->start_regno;
-      old = df_set_note (REG_UNUSED, insn, old, *(mws->loc));
+      old = df_set_note (REG_UNUSED, insn, old, mws->mw_reg);
 
 #ifdef REG_DEAD_DEBUGGING
       df_print_note ("adding 1: ", insn, REG_NOTES (insn));
@@ -3773,6 +3791,34 @@ df_set_unused_notes_for_mw (rtx insn, rt
 }
 
 
+/* A subroutine of df_set_dead_notes_for_mw, with a selection of its
+   arguments.  Return true if the register value described by MWS's
+   mw_reg is known to be completely dead, and if mw_reg can therefore
+   be used in a REG_DEAD note.  */
+
+static bool
+df_whole_mw_reg_dead_p (struct df_mw_hardreg *mws,
+			bitmap live, bitmap artificial_uses,
+			bitmap do_not_gen)
+{
+  unsigned int r;
+
+  /* If MWS describes a partial reference, create REG_DEAD notes for
+     individual hard registers.  */
+  if (mws->flags & DF_REF_PARTIAL)
+    return false;
+
+  /* Likewise if some part of the register is not dead.  */
+  for (r = mws->start_regno; r <= mws->end_regno; r++)
+    if (bitmap_bit_p (live, r)
+	|| bitmap_bit_p (artificial_uses, r)
+	|| bitmap_bit_p (do_not_gen, r))
+      return false;
+
+  gcc_assert (REG_P (mws->mw_reg));
+  return true;
+}
+
 /* Set the REG_DEAD notes for the multiword hardreg use in INSN based
    on the bits in LIVE.  DO_NOT_GEN is used to keep REG_DEAD notes
    from being set if the instruction both reads and writes the
@@ -3783,7 +3829,6 @@ df_set_dead_notes_for_mw (rtx insn, rtx 
 			  bitmap live, bitmap do_not_gen,
 			  bitmap artificial_uses)
 {
-  bool all_dead = true;
   unsigned int r;
   
 #ifdef REG_DEAD_DEBUGGING
@@ -3799,25 +3844,13 @@ df_set_dead_notes_for_mw (rtx insn, rtx 
     }
 #endif
 
-  for (r = mws->start_regno; r <= mws->end_regno; r++)
-    if ((bitmap_bit_p (live, r))
-	|| bitmap_bit_p (artificial_uses, r)
-	|| bitmap_bit_p (do_not_gen, r))
-      {
-	all_dead = false;
-	break;
-      }
-  
-  if (all_dead)
+  if (df_whole_mw_reg_dead_p (mws, live, artificial_uses, do_not_gen))
     {
-      if (!bitmap_bit_p (do_not_gen, mws->start_regno))
-	{
-	  /* Add a dead note for the entire multi word register.  */
-	  old = df_set_note (REG_DEAD, insn, old, *(mws->loc));
+      /* Add a dead note for the entire multi word register.  */
+      old = df_set_note (REG_DEAD, insn, old, mws->mw_reg);
 #ifdef REG_DEAD_DEBUGGING
-	  df_print_note ("adding 1: ", insn, REG_NOTES (insn));
+      df_print_note ("adding 1: ", insn, REG_NOTES (insn));
 #endif
-	}
     }
   else
     {
Index: reg-stack.c
===================================================================
--- reg-stack.c	(revision 126286)
+++ reg-stack.c	(working copy)
@@ -3243,7 +3243,7 @@ struct tree_opt_pass pass_stack_regs_run
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'k'                                   /* letter */
Index: sched-rgn.c
===================================================================
--- sched-rgn.c	(revision 126286)
+++ sched-rgn.c	(working copy)
@@ -3169,7 +3169,7 @@ struct tree_opt_pass pass_sched =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_verify_flow |
   TODO_ggc_collect,                     /* todo_flags_finish */
@@ -3189,7 +3189,7 @@ struct tree_opt_pass pass_sched2 =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_verify_flow |
   TODO_ggc_collect,                     /* todo_flags_finish */
Index: passes.c
===================================================================
--- passes.c	(revision 126286)
+++ passes.c	(working copy)
@@ -321,7 +321,7 @@ struct tree_opt_pass pass_postreload =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_ggc_collect,                     /* todo_flags_finish */
+  TODO_ggc_collect | TODO_verify_rtl_sharing, /* todo_flags_finish */
   0					/* letter */
 };
 
@@ -976,6 +976,8 @@ execute_function_todo (void *data)
     verify_stmts ();
   if (flags & TODO_verify_loops)
     verify_loop_closed_ssa ();
+  if (flags & TODO_verify_rtl_sharing)
+    verify_rtl_sharing ();
 #endif
 
   cfun->last_verified = flags & TODO_verify_all;
Index: combine-stack-adj.c
===================================================================
--- combine-stack-adj.c	(revision 126286)
+++ combine-stack-adj.c	(working copy)
@@ -486,7 +486,7 @@ struct tree_opt_pass pass_stack_adjustme
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_dump_func |
   TODO_ggc_collect,                     /* todo_flags_finish */
   0                                     /* letter */
Index: dce.c
===================================================================
--- dce.c	(revision 126286)
+++ dce.c	(working copy)
@@ -499,7 +499,7 @@ struct tree_opt_pass pass_ud_rtl_dce =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'w'                                   /* letter */
 };
@@ -806,7 +806,7 @@ struct tree_opt_pass pass_fast_rtl_dce =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func |
-  TODO_df_finish |
+  TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_ggc_collect,                     /* todo_flags_finish */
   'w'                                   /* letter */
 };


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