X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcfgloopanal.c;h=c00d1c501be93703e362ac52a3a976904158992a;hb=26991c0d206a7ca1c6559d7217773ba51ea62805;hp=53d36d94ffccab812386c2a950b4f6e133e64be1;hpb=f780cc25eaffc78f268a94471da728ac7945751f;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index 53d36d94ffc..c00d1c501be 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -1,11 +1,11 @@ /* Natural loop analysis code for GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -34,7 +33,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA /* Checks whether BB is executed exactly once in each LOOP iteration. */ bool -just_once_each_iteration_p (const struct loop *loop, basic_block bb) +just_once_each_iteration_p (const struct loop *loop, const_basic_block bb) { /* It must be executed at least once each iteration. */ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb)) @@ -157,12 +156,12 @@ mark_irreducible_loops (void) free_graph (g); - current_loops->state |= LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS; + loops_state_set (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS); } /* Counts number of insns inside LOOP. */ int -num_loop_insns (struct loop *loop) +num_loop_insns (const struct loop *loop) { basic_block *bbs, bb; unsigned i, ninsns = 0; @@ -184,7 +183,7 @@ num_loop_insns (struct loop *loop) /* Counts number of insns executed on average per iteration LOOP. */ int -average_num_loop_insns (struct loop *loop) +average_num_loop_insns (const struct loop *loop) { basic_block *bbs, bb; unsigned i, binsns, ninsns, ratio; @@ -295,7 +294,7 @@ get_loop_level (const struct loop *loop) /* Returns estimate on cost of computing SEQ. */ static unsigned -seq_cost (rtx seq) +seq_cost (const_rtx seq) { unsigned cost = 0; rtx set; @@ -335,6 +334,7 @@ init_set_costs (void) rtx mem = validize_mem (gen_rtx_MEM (SImode, addr)); unsigned i; + target_avail_regs = 0; for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i) && !fixed_regs[i])