egcs, haifa-sched.c warning fixes
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Tue Feb 17 14:10:00 GMT 1998
Here are some warning fixes to haifa-sched.c.
--Kaveh
Mon Feb 16 15:21:54 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* haifa-sched.c: Include "system.h" to get <stdlib.h> and <stdio.h>.
(BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |.
(sched_note_set): Remove unused parameter `b', all callers changed.
(schedule_block): Likewise for `rgn'.
(split_hard_reg_notes): Likewise for `orig_insn'.
(check_live): Likewise for `trg'.
(update_live): Likewise.
(check_live_1): Explcitly declare variable `i' as int.
(update_live_1): Likewise.
(insn_issue_delay): Remove unused variable `link'.
(sched_analyze_2): Add default case in enumeration switch.
(schedule_insns): Remove unused variable `i'.
* Makefile.in ($(SCHED_PREFIX)sched.o): Depend on system.h.
--- gcc/Makefile.in~ Wed Feb 11 17:26:23 1998
+++ gcc/Makefile.in Tue Feb 17 11:40:13 1998
@@ -1415,8 +1415,9 @@
insn-codes.h
regmove.o : regmove.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
recog.h output.h reload.h regs.h hard-reg-set.h flags.h expr.h insn-flags.h
-$(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) $(RTL_H) $(BASIC_BLOCK_H) regs.h hard-reg-set.h \
- flags.h insn-config.h insn-attr.h
+$(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) $(RTL_H) \
+ $(BASIC_BLOCK_H) regs.h hard-reg-set.h flags.h insn-config.h \
+ insn-attr.h system.h
final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h regs.h \
$(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \
hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
--- gcc/haifa-sched.c~ Mon Feb 16 15:07:51 1998
+++ gcc/haifa-sched.c Mon Feb 16 15:08:17 1998
@@ -154,8 +154,8 @@
priorities are computed, and (3) block level: insns in the block
are actually scheduled. */
-#include <stdio.h>
#include "config.h"
+#include "system.h"
#include "rtl.h"
#include "basic-block.h"
#include "regs.h"
@@ -320,7 +320,7 @@
#define UNIT_BLOCKED(B) ((B) >> (2 * BLOCKAGE_BITS))
#define BLOCKAGE_RANGE(B) \
(((((B) >> BLOCKAGE_BITS) & BLOCKAGE_MASK) << (HOST_BITS_PER_INT / 2)) \
- | (B) & BLOCKAGE_MASK)
+ | ((B) & BLOCKAGE_MASK))
/* Encodings of the `<name>_unit_blockage_range' function. */
#define MIN_BLOCKAGE_COST(R) ((R) >> (HOST_BITS_PER_INT / 2))
@@ -457,7 +457,7 @@
static void sched_analyze_2 PROTO ((rtx, rtx));
static void sched_analyze_insn PROTO ((rtx, rtx, rtx));
static void sched_analyze PROTO ((rtx, rtx));
-static void sched_note_set PROTO ((int, rtx, int));
+static void sched_note_set PROTO ((rtx, int));
static int rank_for_schedule PROTO ((rtx *, rtx *));
static void swap_sort PROTO ((rtx *, int));
static void queue_insn PROTO ((rtx, int));
@@ -467,9 +467,9 @@
static void attach_deaths_insn PROTO ((rtx));
static int new_sometimes_live PROTO ((struct sometimes *, int, int));
static void finish_sometimes_live PROTO ((struct sometimes *, int));
-static int schedule_block PROTO ((int, int, int));
+static int schedule_block PROTO ((int, int));
static rtx regno_use_in PROTO ((int, rtx));
-static void split_hard_reg_notes PROTO ((rtx, rtx, rtx, rtx));
+static void split_hard_reg_notes PROTO ((rtx, rtx, rtx));
static void new_insn_dead_notes PROTO ((rtx, rtx, rtx, rtx));
static void update_n_sets PROTO ((rtx, int));
static void update_flow_info PROTO ((rtx, rtx, rtx, rtx));
@@ -707,8 +707,8 @@
/* speculative scheduling functions */
static int check_live_1 PROTO ((int, rtx));
static void update_live_1 PROTO ((int, rtx));
-static int check_live PROTO ((rtx, int, int));
-static void update_live PROTO ((rtx, int, int));
+static int check_live PROTO ((rtx, int));
+static void update_live PROTO ((rtx, int));
static void set_spec_fed PROTO ((rtx));
static int is_pfree PROTO ((rtx, int, int));
static int find_conditional_protection PROTO ((rtx, int));
@@ -2166,7 +2166,7 @@
int src;
rtx x;
{
- register i;
+ register int i;
register int regno;
register rtx reg = SET_DEST (x);
@@ -2234,7 +2234,7 @@
int src;
rtx x;
{
- register i;
+ register int i;
register int regno;
register rtx reg = SET_DEST (x);
@@ -2287,10 +2287,9 @@
ready-list or before the scheduling. */
static int
-check_live (insn, src, trg)
+check_live (insn, src)
rtx insn;
int src;
- int trg;
{
/* find the registers set by instruction */
if (GET_CODE (PATTERN (insn)) == SET
@@ -2316,9 +2315,9 @@
block src to trg. */
static void
-update_live (insn, src, trg)
+update_live (insn, src)
rtx insn;
- int src, trg;
+ int src;
{
/* find the registers set by instruction */
if (GET_CODE (PATTERN (insn)) == SET
@@ -2936,7 +2935,6 @@
insn_issue_delay (insn)
rtx insn;
{
- rtx link;
int i, delay = 0;
int unit = insn_unit (insn);
@@ -3725,6 +3723,9 @@
sched_analyze_2 (XEXP (x, 0), insn);
sched_analyze_1 (x, insn);
return;
+
+ default:
+ break;
}
/* Other cases: walk the insn. */
@@ -4026,8 +4027,7 @@
are scanning forwards. Mark that register as being born. */
static void
-sched_note_set (b, x, death)
- int b;
+sched_note_set (x, death)
rtx x;
int death;
{
@@ -4394,7 +4394,7 @@
|| CANT_MOVE (next)
|| (IS_SPECULATIVE_INSN (next)
&& (insn_issue_delay (next) > 3
- || !check_live (next, INSN_BB (next), target_bb)
+ || !check_live (next, INSN_BB (next))
|| !is_exception_free (next, INSN_BB (next), target_bb)))))
continue;
@@ -5184,7 +5184,7 @@
if (GET_CODE (PATTERN (insn)) == SET
|| GET_CODE (PATTERN (insn)) == CLOBBER)
{
- sched_note_set (b, PATTERN (insn), 0);
+ sched_note_set (PATTERN (insn), 0);
reg_weight++;
}
@@ -5195,7 +5195,7 @@
if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET
|| GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER)
{
- sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0);
+ sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
reg_weight++;
}
@@ -5203,7 +5203,7 @@
is harmless though, so we will leave it in for now. */
for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == USE)
- sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0);
+ sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
}
/* Each call cobbers (makes live) all call-clobbered regs
@@ -5366,13 +5366,13 @@
if (GET_CODE (PATTERN (insn)) == SET
|| GET_CODE (PATTERN (insn)) == CLOBBER)
- sched_note_set (b, PATTERN (insn), 1);
+ sched_note_set (PATTERN (insn), 1);
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
{
for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET
|| GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER)
- sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 1);
+ sched_note_set (XVECEXP (PATTERN (insn), 0, j), 1);
}
/* This code keeps life analysis information up to date. */
@@ -6579,9 +6579,8 @@
Return number of insns scheduled. */
static int
-schedule_block (bb, rgn, rgn_n_insns)
+schedule_block (bb, rgn_n_insns)
int bb;
- int rgn;
int rgn_n_insns;
{
/* Local variables. */
@@ -6750,7 +6749,7 @@
if (!CANT_MOVE (insn)
&& (!IS_SPECULATIVE_INSN (insn)
|| (insn_issue_delay (insn) <= 3
- && check_live (insn, bb_src, target_bb)
+ && check_live (insn, bb_src)
&& is_exception_free (insn, bb_src, target_bb))))
{
@@ -6856,14 +6855,14 @@
if (IS_SPECULATIVE_INSN (insn))
{
- if (!check_live (insn, INSN_BB (insn), target_bb))
+ if (!check_live (insn, INSN_BB (insn)))
{
/* speculative motion, live check failed, remove
insn from ready list */
ready[i] = ready[--n_ready];
continue;
}
- update_live (insn, INSN_BB (insn), target_bb);
+ update_live (insn, INSN_BB (insn));
/* for speculative load, mark insns fed by it. */
if (IS_LOAD_INSN (insn) || FED_BY_SPEC_LOAD (insn))
@@ -7629,7 +7628,7 @@
/* now we can schedule all blocks */
for (bb = 0; bb < current_nr_blocks; bb++)
{
- sched_rgn_n_insns += schedule_block (bb, rgn, rgn_n_insns);
+ sched_rgn_n_insns += schedule_block (bb, rgn_n_insns);
#ifdef USE_C_ALLOCA
alloca (0);
@@ -7710,8 +7709,8 @@
several smaller hard register references in the split insns. */
static void
-split_hard_reg_notes (note, first, last, orig_insn)
- rtx note, first, last, orig_insn;
+split_hard_reg_notes (note, first, last)
+ rtx note, first, last;
{
rtx reg, temp, link;
int n_regs, i, new_reg;
@@ -7933,7 +7932,7 @@
&& GET_CODE (temp) == REG
&& REGNO (temp) < FIRST_PSEUDO_REGISTER
&& HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) > 1)
- split_hard_reg_notes (note, first, last, orig_insn);
+ split_hard_reg_notes (note, first, last);
else
{
XEXP (note, 1) = REG_NOTES (insn);
@@ -8463,7 +8462,6 @@
int max_uid;
int b;
- int i;
rtx insn;
int rgn;
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.
More information about the Gcc
mailing list