X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fregclass.c;h=ea6c86b6c578e7366f67823fd6b1c90abf45abd4;hp=21cb6ead80f2be0961d2fff0f2de149855b0e043;hb=c8a9f9bf2f66b56de7ce884ef251c167dbc0d4aa;hpb=922df7274cc783f696481502ae49f7d44a671400 diff --git a/gcc/regclass.c b/gcc/regclass.c index 21cb6ead80f..ea6c86b6c57 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static void init_reg_sets_1 PARAMS ((void)); static void init_reg_modes PARAMS ((void)); +static void init_reg_autoinc PARAMS ((void)); /* If we have auto-increment or auto-decrement and we can have secondary reloads, we are not allowed to use classes requiring secondary @@ -578,6 +579,8 @@ init_regs () init_reg_sets_1 (); init_reg_modes (); + + init_reg_autoinc (); } /* Initialize some fake stack-frame MEM references for use in @@ -1143,37 +1146,18 @@ scan_one_insn (insn, pass) return insn; } -/* This is a pass of the compiler that scans all instructions - and calculates the preferred class for each pseudo-register. - This information can be accessed later by calling `reg_preferred_class'. - This pass comes just before local register allocation. */ +/* Initialize information about which register classes can be used for + pseudos that are auto-incremented or auto-decremented. */ -void -regclass (f, nregs, dump) - rtx f; - int nregs; - FILE *dump; +static void +init_reg_autoinc () { - rtx insn; - int i; - int pass; - - init_recog (); - - costs = (struct costs *) xmalloc (nregs * sizeof (struct costs)); - #ifdef FORBIDDEN_INC_DEC_CLASSES - - in_inc_dec = (char *) xmalloc (nregs); - - /* Initialize information about which register classes can be used for - pseudos that are auto-incremented or auto-decremented. It would - seem better to put this in init_reg_sets, but we need to be able - to allocate rtx, which we can't do that early. */ + int i; for (i = 0; i < N_REG_CLASSES; i++) { - rtx r = gen_rtx_REG (VOIDmode, 0); + rtx r = gen_rtx_raw_REG (VOIDmode, 0); enum machine_mode m; int j; @@ -1214,6 +1198,32 @@ regclass (f, nregs, dump) } } #endif /* FORBIDDEN_INC_DEC_CLASSES */ +} + +/* This is a pass of the compiler that scans all instructions + and calculates the preferred class for each pseudo-register. + This information can be accessed later by calling `reg_preferred_class'. + This pass comes just before local register allocation. */ + +void +regclass (f, nregs, dump) + rtx f; + int nregs; + FILE *dump; +{ + rtx insn; + int i; + int pass; + + init_recog (); + + costs = (struct costs *) xmalloc (nregs * sizeof (struct costs)); + +#ifdef FORBIDDEN_INC_DEC_CLASSES + + in_inc_dec = (char *) xmalloc (nregs); + +#endif /* FORBIDDEN_INC_DEC_CLASSES */ /* Normally we scan the insns once and determine the best class to use for each register. However, if -fexpensive_optimizations are on, we do so