X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fcselib.c;h=64f183f2b1e49cc4ac844f82cbc8dbda0b6d74ff;hp=af2bb0ee0a53b70dab0ab672a30f119bc5c722f4;hb=f0f39928e5687eb3bb28dc6eda9e39f28b22e7d2;hpb=a7a4626828090600459358ca745c4482cf9551a1 diff --git a/gcc/cselib.c b/gcc/cselib.c index af2bb0ee0a5..64f183f2b1e 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "recog.h" #include "function.h" #include "emit-rtl.h" +#include "diagnostic-core.h" #include "toplev.h" #include "output.h" #include "ggc.h" @@ -42,6 +43,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "alloc-pool.h" #include "target.h" +#include "bitmap.h" static bool cselib_record_memory; static bool cselib_preserve_constants; @@ -177,6 +179,7 @@ static cselib_val dummy_val; that is constant through the whole function and should never be eliminated. */ static cselib_val *cfa_base_preserved_val; +static unsigned int cfa_base_preserved_regno; /* Used to list all values that contain memory reference. May or may not contain the useless values - the list is compacted @@ -337,7 +340,7 @@ cselib_reset_table (unsigned int num) if (cfa_base_preserved_val) { - unsigned int regno = REGNO (cfa_base_preserved_val->locs->loc); + unsigned int regno = cfa_base_preserved_regno; unsigned int new_used_regs = 0; for (i = 0; i < n_used_regs; i++) if (used_regs[i] == regno) @@ -570,12 +573,15 @@ cselib_preserved_value_p (cselib_val *v) never invalidated and preserved across cselib_reset_table calls. */ void -cselib_preserve_cfa_base_value (cselib_val *v) +cselib_preserve_cfa_base_value (cselib_val *v, unsigned int regno) { if (cselib_preserve_constants && v->locs && REG_P (v->locs->loc)) - cfa_base_preserved_val = v; + { + cfa_base_preserved_val = v; + cfa_base_preserved_regno = regno; + } } /* Clean all non-constant expressions in the hash table, but retain @@ -1782,7 +1788,9 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode) if (i < FIRST_PSEUDO_REGISTER && v != NULL) this_last = end_hard_regno (GET_MODE (v->val_rtx), i) - 1; - if (this_last < regno || v == NULL || v == cfa_base_preserved_val) + if (this_last < regno || v == NULL + || (v == cfa_base_preserved_val + && i == cfa_base_preserved_regno)) { l = &(*l)->next; continue; @@ -2265,6 +2273,7 @@ cselib_finish (void) cselib_discard_hook = NULL; cselib_preserve_constants = false; cfa_base_preserved_val = NULL; + cfa_base_preserved_regno = INVALID_REGNUM; free_alloc_pool (elt_list_pool); free_alloc_pool (elt_loc_list_pool); free_alloc_pool (cselib_val_pool);