summaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-19 18:19:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-19 18:19:39 +0000
commite56043cd2c207982e812ce6fcecb7353dea58363 (patch)
tree01a6f37ad5a9ae6b18bdc20f052b04e19b4255c0 /gcc/cselib.c
parent2e02a1a4548f2ee1ea519c88e68b20621ad16fcc (diff)
downloadgcc-e56043cd2c207982e812ce6fcecb7353dea58363.tar.gz
2010-09-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 164348, with some improvements in gcc/melt-runtime.[ch] 2010-09-19 Basile Starynkevitch <basile@starynkevitch.net> [[merged with trunk rev.164348, so improved MELT runtime!]] * gcc/melt-runtime.h: improved comments. (melt_debug_garbcoll, melt_debuggc_eprintf): Moved from melt-runtime.c. (melt_obmag_string): New declaration. (struct meltobject_st, struct meltclosure_st, struct meltroutine_st, struct meltmixbigint_st, struct meltstring_st): using GTY variable_size and @@MELTGTY@@ comment. (melt_mark_special): added debug print. * gcc/melt-runtime.c: Improved comments. Include bversion.h, realmpfr.h, gimple-pretty-print.h. (ggc_force_collect) Declared external. (melt_forward_counter): Added. (melt_obmag_string): New function. (melt_alptr_1, melt_alptr_2, melt_break_alptr_1_at) (melt_break_alptr_2_at, melt_break_alptr_1,melt_break_alptr_1) (melt_allocate_young_gc_zone, melt_free_young_gc_zone): New. (delete_special, meltgc_make_special): Improved debug printf and use melt_break_alptr_1... (ggc_alloc_*) macros defined for backport to GCC 4.5 (melt_forwarded_copy): Don't clear the new destination zone in old GGC heap. (meltgc_add_out_raw_len): Use ggc_alloc_atomic. (meltgc_raw_new_mappointers, meltgc_raw_put_mappointers) (meltgc_raw_remove_mappointers): Corrected length argument to ggc_alloc_cleared_vec_entrypointermelt_st. (melt_really_initialize): Call melt_allocate_young_gc_zone. (melt_initialize): Set flag_plugin_added. (melt_val2passflag): TODO_verify_loops only in GCC 4.5 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@164424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index f46c5ecb29b..05029fa286c 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -29,11 +29,11 @@ along with GCC; see the file COPYING3. If not see
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
-#include "real.h"
#include "insn-config.h"
#include "recog.h"
#include "function.h"
#include "emit-rtl.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
@@ -43,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;
@@ -178,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
@@ -338,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)
@@ -571,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
@@ -695,6 +700,10 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
case DEBUG_EXPR:
return 0;
+ case DEBUG_IMPLICIT_PTR:
+ return DEBUG_IMPLICIT_PTR_DECL (x)
+ == DEBUG_IMPLICIT_PTR_DECL (y);
+
case LABEL_REF:
return XEXP (x, 0) == XEXP (y, 0);
@@ -829,6 +838,11 @@ cselib_hash_rtx (rtx x, int create)
+ DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x));
return hash ? hash : (unsigned int) DEBUG_EXPR;
+ case DEBUG_IMPLICIT_PTR:
+ hash += ((unsigned) DEBUG_IMPLICIT_PTR << 7)
+ + DECL_UID (DEBUG_IMPLICIT_PTR_DECL (x));
+ return hash ? hash : (unsigned int) DEBUG_IMPLICIT_PTR;
+
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + INTVAL (x);
return hash ? hash : (unsigned int) CONST_INT;
@@ -1783,7 +1797,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;
@@ -2266,6 +2282,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);