diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42db6357cc1..5023208ea0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Fri Feb 28 11:09:14 CET 2003 Jan Hubicka + + * combine.c (gen_lowpart_for_combine): Update handling of + subregs_of_mode + * flow.c (life_analysis, mark_used_regs): Likewise. + * regclass.c (subregs_of_mode): Turn into single bitmap. + (cannot_change-mode_set_regs, invalid_mode_change_p): Update + dealing with subregs_of_mode + * regs.h (subregs_of_mode): Update prototype. + 2003-02-28 Josef Zlomek * emit-rtl.c (set_reg_attrs_for_parm): New function. diff --git a/gcc/combine.c b/gcc/combine.c index 50b1876eb58..e1933870251 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -10201,8 +10201,9 @@ gen_lowpart_for_combine (mode, x) && GET_CODE (result) == SUBREG && GET_CODE (SUBREG_REG (result)) == REG && REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER) - SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (result)], - REGNO (SUBREG_REG (result))); + bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (result)) + * MAX_MACHINE_MODE + + GET_MODE (result)); #endif if (result) diff --git a/gcc/flow.c b/gcc/flow.c index 24f869153c0..fb60610a7a8 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -436,11 +436,7 @@ life_analysis (f, file, flags) #ifdef CANNOT_CHANGE_MODE_CLASS if (flags & PROP_REG_INFO) - { - int j; - for (j=0; j < NUM_MACHINE_MODES; ++j) - INIT_REG_SET (&subregs_of_mode[j]); - } + bitmap_initialize (&subregs_of_mode, 1); #endif if (! optimize) @@ -3845,8 +3841,9 @@ mark_used_regs (pbi, x, cond, insn) #ifdef CANNOT_CHANGE_MODE_CLASS if (GET_CODE (SUBREG_REG (x)) == REG && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER) - SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (x)], - REGNO (SUBREG_REG (x))); + bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x)) + * MAX_MACHINE_MODE + + GET_MODE (x)); #endif /* While we're here, optimize this case. */ @@ -3894,8 +3891,9 @@ mark_used_regs (pbi, x, cond, insn) if (GET_CODE (testreg) == SUBREG && GET_CODE (SUBREG_REG (testreg)) == REG && REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER) - SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (testreg)], - REGNO (SUBREG_REG (testreg))); + bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg)) + * MAX_MACHINE_MODE + + GET_MODE (testreg)); #endif /* Modifying a single register in an alternate mode diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 52be2a20bc2..8626d636778 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -428,9 +428,6 @@ reg_to_stack (first, file) /* Clean up previous run. */ stack_regs_mentioned_data = 0; - if (!optimize) - split_all_insns (0); - /* See if there is something to do. Flow analysis is quite expensive so we might save some compilation time. */ for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) diff --git a/gcc/regclass.c b/gcc/regclass.c index abbd6eabe3d..01c08f3a078 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -232,9 +232,9 @@ static char *in_inc_dec; #endif /* FORBIDDEN_INC_DEC_CLASSES */ #ifdef CANNOT_CHANGE_MODE_CLASS -/* All registers that have been subreged. Indexed by mode, where each - entry is a regset of registers. */ -regset_head subregs_of_mode [NUM_MACHINE_MODES]; +/* All registers that have been subreged. Indexed by regno * MAX_MACHINE_MODE + + mode. */ +bitmap_head subregs_of_mode; #endif /* Sample MEM values for use by memory_move_secondary_cost. */ @@ -2638,16 +2638,18 @@ cannot_change_mode_set_regs (used, from, regno) unsigned int regno; { enum machine_mode to; + int n, i; + int start = regno * MAX_MACHINE_MODE; - for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to) - if (REGNO_REG_SET_P (&subregs_of_mode[to], regno)) - { - int i; - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (! TEST_HARD_REG_BIT (*used, i) - && REG_CANNOT_CHANGE_MODE_P (i, from, to)) - SET_HARD_REG_BIT (*used, i); - } + EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n, + if (n >= MAX_MACHINE_MODE + start) + return; + to = n - start; + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (! TEST_HARD_REG_BIT (*used, i) + && REG_CANNOT_CHANGE_MODE_P (i, from, to)) + SET_HARD_REG_BIT (*used, i); + ); } /* Return 1 if REGNO has had an invalid mode change in CLASS from FROM @@ -2660,11 +2662,16 @@ invalid_mode_change_p (regno, class, from_mode) enum machine_mode from_mode; { enum machine_mode to_mode; + int n; + int start = regno * MAX_MACHINE_MODE; - for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode) - if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno) - && CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class)) + EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n, + if (n >= MAX_MACHINE_MODE + start) + return 0; + to_mode = n - start; + if (CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class)) return 1; + ); return 0; } #endif /* CANNOT_CHANGE_MODE_CLASS */ diff --git a/gcc/regs.h b/gcc/regs.h index 4a78212ec80..2e838e32939 100644 --- a/gcc/regs.h +++ b/gcc/regs.h @@ -66,7 +66,7 @@ typedef struct reg_info_def extern varray_type reg_n_info; -extern regset_head subregs_of_mode [NUM_MACHINE_MODES]; +extern bitmap_head subregs_of_mode; /* Indexed by n, gives number of times (REG n) is used or set. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index b90edcba5a8..ef0ac60ded7 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3458,7 +3458,9 @@ rest_of_compilation (decl) #endif /* If optimizing, then go ahead and split insns now. */ +#ifndef STACK_REGS if (optimize > 0) +#endif split_all_insns (0); cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0); @@ -3551,10 +3553,6 @@ rest_of_compilation (decl) close_dump_file (DFI_ce3, print_rtl_with_bb, insns); timevar_pop (TV_IFCVT2); } -#ifdef STACK_REGS - if (optimize) - split_all_insns (1); -#endif #ifdef INSN_SCHEDULING if (optimize > 0 && flag_schedule_insns_after_reload)