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]

[patch] toplev.c: Hide rest_of_handle_sched() if INSN_SCHEDULINGis not defined.


Hi,

Attached is a patch to hide rest_of_handle_sched() if INSN_SCHEDULING
is not defined.  On a machine with INSN_SCHEDULING defined, the patch
has no effect, but on a machine without, two warnings about unused
arguments warning go away.  I thought about saying

static void
rest_of_handle_sched (
#ifdef INSN_SCHEDULING
                      tree decl, rtx insns
#else
                      tree decl ATTRIBUTE_UNUSED, rtx insns ATTRIBUTE_UNUSED
#endif
                     )

but I guess this is quite ugly for an almost empty function without
INSN_SCHEDULING defined.  If we need to keep a call to ggc_collect(),
we can place it immediately after a call to rest_of_handle_sched().

Tested on h8300 port.  OK to apply?

Kazu Hirata

2003-06-17  Kazu Hirata  <kazu@cs.umass.edu>

	* toplev.c (rest_of_handle_sched): Hide the entire function if
	INSN_SCHEDULING is not defined.
	(rest_of_compilation): Call rest_of_handle_sched() only when
	INSN_SCHEDULING is defined.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.774
diff -u -7 -p -r1.774 toplev.c
--- toplev.c	17 Jun 2003 05:09:12 -0000	1.774
+++ toplev.c	18 Jun 2003 00:33:32 -0000
@@ -147,16 +147,16 @@ static void rest_of_handle_addresof (tre
 static void rest_of_handle_cfg (tree, rtx);
 static void rest_of_handle_branch_prob (tree, rtx);
 static void rest_of_handle_if_conversion (tree, rtx);
 static void rest_of_handle_if_after_combine (tree, rtx);
 static void rest_of_handle_tracer (tree, rtx);
 static void rest_of_handle_combine (tree, rtx);
 static void rest_of_handle_regmove (tree, rtx);
-static void rest_of_handle_sched (tree, rtx);
 #ifdef INSN_SCHEDULING
+static void rest_of_handle_sched (tree, rtx);
 static void rest_of_handle_sched2 (tree, rtx);
 #endif
 static bool rest_of_handle_new_regalloc (tree, rtx, int *);
 static bool rest_of_handle_old_regalloc (tree, rtx, int *);
 static void rest_of_handle_regrename (tree, rtx);
 static void rest_of_handle_reorder_blocks (tree, rtx);
 #ifdef STACK_REGS
@@ -2667,41 +2667,39 @@ rest_of_handle_reorder_blocks (tree decl
       || (flag_sched2_use_traces && flag_schedule_insns_after_reload))
     cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
 
   close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
   timevar_pop (TV_REORDER_BLOCKS);
 }
 
+#ifdef INSN_SCHEDULING
 /* Run instruction scheduler.  */
 static void
 rest_of_handle_sched (tree decl, rtx insns)
 {
   timevar_push (TV_SCHED);
-#ifdef INSN_SCHEDULING
 
   /* Print function header into sched dump now
      because doing the sched analysis makes some of the dump.  */
   if (optimize > 0 && flag_schedule_insns)
     {
       open_dump_file (DFI_sched, decl);
 
       /* Do control and data sched analysis,
 	 and write some of the results to dump file.  */
 
       schedule_insns (rtl_dump_file);
 
       close_dump_file (DFI_sched, print_rtl_with_bb, insns);
     }
-#endif
   timevar_pop (TV_SCHED);
 
   ggc_collect ();
 }
 
-#ifdef INSN_SCHEDULING
 /* Run second scheduling pass after reload.  */
 static void
 rest_of_handle_sched2 (tree decl, rtx insns)
 {
   timevar_push (TV_SCHED2);
   open_dump_file (DFI_sched2, decl);
 
@@ -3733,15 +3731,17 @@ rest_of_compilation (tree decl)
 #endif
 
   /* Any of the several passes since flow1 will have munged register
      lifetime data a bit.  We need it to be up to date for scheduling
      (see handling of reg_known_equiv in init_alias_analysis).  */
   recompute_reg_usage (insns, !optimize_size);
 
+#ifdef INSN_SCHEDULING
   rest_of_handle_sched (decl, insns);
+#endif
 
   /* Determine if the current function is a leaf before running reload
      since this can impact optimizations done by the prologue and
      epilogue thus changing register elimination offsets.  */
   current_function_is_leaf = leaf_function_p ();
 
   timevar_push (TV_LOCAL_ALLOC);


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