diff options
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/basic-block.h | 1 | ||||
-rw-r--r-- | gcc/df.c | 28 | ||||
-rw-r--r-- | gcc/df.h | 5 | ||||
-rw-r--r-- | gcc/flow.c | 7 |
5 files changed, 32 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0335b06813..75a1007cc22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Fri Jan 25 20:43:56 CET 2002 Jan Hubicka <jh@suse.cz> + + * df.c (df_ref_create, df_ref_record_1, df_ref_record): Kill BB argument. + * df.h (struct ref): Kill B. + (DF_REF_BB, DF_REF_BBNO): Use BLOCK_FOR_INSN. + + * basic-block.h (PROP_EQUAL_NOTES): New flag. + * flow.c (propagate_one_insn): Use it. + (mark_used_regs): Handle NIL. + 2001-01-25 Geoffrey Keating <geoffk@redhat.com> * config/stormy16/stormy16.md (tablejump_pcrel): Use a MEM diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 29df84af335..1bc1d780f19 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -560,6 +560,7 @@ enum update_life_extent #define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed by dead code removal. */ #define PROP_AUTOINC 64 /* Create autoinc mem references. */ +#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */ #define PROP_FINAL 127 /* All of the above. */ #define CLEANUP_EXPENSIVE 1 /* Do relativly expensive optimizations @@ -226,13 +226,13 @@ static void df_refs_unlink PARAMS ((struct df *, bitmap)); #endif static struct ref *df_ref_create PARAMS((struct df *, - rtx, rtx *, basic_block, rtx, + rtx, rtx *, rtx, enum df_ref_type, enum df_ref_flags)); static void df_ref_record_1 PARAMS((struct df *, rtx, rtx *, - basic_block, rtx, enum df_ref_type, + rtx, enum df_ref_type, enum df_ref_flags)); static void df_ref_record PARAMS((struct df *, rtx, rtx *, - basic_block bb, rtx, enum df_ref_type, + rtx, enum df_ref_type, enum df_ref_flags)); static void df_def_record_1 PARAMS((struct df *, rtx, basic_block, rtx)); static void df_defs_record PARAMS((struct df *, rtx, basic_block, rtx)); @@ -794,11 +794,10 @@ df_use_unlink (df, use) /* Create a new ref of type DF_REF_TYPE for register REG at address LOC within INSN of BB. */ static struct ref * -df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) +df_ref_create (df, reg, loc, insn, ref_type, ref_flags) struct df *df; rtx reg; rtx *loc; - basic_block bb; rtx insn; enum df_ref_type ref_type; enum df_ref_flags ref_flags; @@ -810,7 +809,6 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) sizeof (*this_ref)); DF_REF_REG (this_ref) = reg; DF_REF_LOC (this_ref) = loc; - DF_REF_BB (this_ref) = bb; DF_REF_INSN (this_ref) = insn; DF_REF_CHAIN (this_ref) = 0; DF_REF_TYPE (this_ref) = ref_type; @@ -848,27 +846,25 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) /* Create a new reference of type DF_REF_TYPE for a single register REG, used inside the LOC rtx of INSN. */ static void -df_ref_record_1 (df, reg, loc, bb, insn, ref_type, ref_flags) +df_ref_record_1 (df, reg, loc, insn, ref_type, ref_flags) struct df *df; rtx reg; rtx *loc; - basic_block bb; rtx insn; enum df_ref_type ref_type; enum df_ref_flags ref_flags; { - df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags); + df_ref_create (df, reg, loc, insn, ref_type, ref_flags); } /* Create new references of type DF_REF_TYPE for each part of register REG at address LOC within INSN of BB. */ static void -df_ref_record (df, reg, loc, bb, insn, ref_type, ref_flags) +df_ref_record (df, reg, loc, insn, ref_type, ref_flags) struct df *df; rtx reg; rtx *loc; - basic_block bb; rtx insn; enum df_ref_type ref_type; enum df_ref_flags ref_flags; @@ -910,11 +906,11 @@ df_ref_record (df, reg, loc, bb, insn, ref_type, ref_flags) for (i = regno; i < endregno; i++) df_ref_record_1 (df, gen_rtx_REG (reg_raw_mode[i], i), - loc, bb, insn, ref_type, ref_flags); + loc, insn, ref_type, ref_flags); } else { - df_ref_record_1 (df, reg, loc, bb, insn, ref_type, ref_flags); + df_ref_record_1 (df, reg, loc, insn, ref_type, ref_flags); } } @@ -978,7 +974,7 @@ df_def_record_1 (df, x, bb, insn) if (GET_CODE (dst) == REG || (GET_CODE (dst) == SUBREG && GET_CODE (SUBREG_REG (dst)) == REG)) - df_ref_record (df, dst, loc, bb, insn, DF_REF_REG_DEF, flags); + df_ref_record (df, dst, loc, insn, DF_REF_REG_DEF, flags); } @@ -1070,7 +1066,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) case REG: /* See a register (or subreg) other than being set. */ - df_ref_record (df, x, loc, bb, insn, ref_type, flags); + df_ref_record (df, x, loc, insn, ref_type, flags); return; case SET: @@ -1161,7 +1157,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) case PRE_MODIFY: case POST_MODIFY: /* Catch the def of the register being modified. */ - df_ref_record (df, XEXP (x, 0), &XEXP (x, 0), bb, insn, DF_REF_REG_DEF, DF_REF_READ_WRITE); + df_ref_record (df, XEXP (x, 0), &XEXP (x, 0), insn, DF_REF_REG_DEF, DF_REF_READ_WRITE); /* ... Fall through to handle uses ... */ @@ -57,7 +57,6 @@ enum df_ref_flags struct ref { rtx reg; /* The register referenced. */ - basic_block bb; /* BB containing ref. */ rtx insn; /* Insn containing ref. */ rtx *loc; /* Loc is the location of the reg. */ struct df_link *chain; /* Head of def-use or use-def chain. */ @@ -175,8 +174,8 @@ struct df_map #define DF_REF_REG(REF) ((REF)->reg) #define DF_REF_LOC(REF) ((REF)->loc) #endif -#define DF_REF_BB(REF) ((REF)->bb) -#define DF_REF_BBNO(REF) ((REF)->bb->index) +#define DF_REF_BB(REF) (BLOCK_FOR_INSN ((REF)->insn)) +#define DF_REF_BBNO(REF) (BLOCK_FOR_INSN ((REF)->insn)->index) #define DF_REF_INSN(REF) ((REF)->insn) #define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn)) #define DF_REF_TYPE(REF) ((REF)->type) diff --git a/gcc/flow.c b/gcc/flow.c index 96bc865c5bf..0325300197e 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1633,6 +1633,7 @@ propagate_one_insn (pbi, insn) ; else { + rtx note; /* Any regs live at the time of a call instruction must not go in a register clobbered by calls. Find all regs now live and record this for them. */ @@ -1688,6 +1689,10 @@ propagate_one_insn (pbi, insn) /* Record uses. */ if (! insn_is_dead) mark_used_regs (pbi, PATTERN (insn), NULL_RTX, insn); + if ((flags & PROP_EQUAL_NOTES) + && ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) + || (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)))) + mark_used_regs (pbi, XEXP (note, 0), NULL_RTX, insn); /* Sometimes we may have inserted something before INSN (such as a move) when we make an auto-inc. So ensure we will scan those insns. */ @@ -3616,6 +3621,8 @@ mark_used_regs (pbi, x, cond, insn) int flags = pbi->flags; retry: + if (!x) + return; code = GET_CODE (x); switch (code) { |