summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-31 20:02:48 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-31 20:02:48 +0000
commit8081d3a635c46337db187a9f6971e707986bf1a8 (patch)
tree3e772ea68b4b52431218cb73789aabb374b906b9 /gcc/alias.c
parent9503eeb0643bb5e6bf6d0557538d9fe5a44aee94 (diff)
downloadgcc-8081d3a635c46337db187a9f6971e707986bf1a8.tar.gz
* cselib.h (cselib_add_permanent_equiv): Declare.
(canonical_cselib_val): New. * cselib.c (new_elt_loc_list): Rework to support value equivalences. Adjust all callers. (preserve_only_constants): Retain value equivalences. (references_value_p): Retain preserved values. (rtx_equal_for_cselib_1): Handle value equivalences. (cselib_invalidate_regno): Use canonical value. (cselib_add_permanent_equiv): New. * alias.c (find_base_term): Reset locs lists while recursing. * var-tracking.c (val_bind): New. Don't add equivalences present in cselib table, compared with code moved from... (val_store): ... here. (val_resolve): Use val_bind. (VAL_EXPR_HAS_REVERSE): Drop. (add_uses): Do not create MOps for addresses. Do not mark non-REG non-MEM expressions as requiring resolution. (reverse_op): Record reverse as a cselib equivalence. (add_stores): Use it. Do not create MOps for addresses. Do not require resolution for non-REG non-MEM expressions. Simplify support for reverse operations. (compute_bb_dataflow): Drop reverse support. (emit_notes_in_bb): Likewise. (create_entry_value): Rename to... (record_entry_value): ... this. Use cselib equivalences. (vt_add_function_parameter): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index ef624a1bfe4..37c3fa062cf 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1542,7 +1542,8 @@ rtx
find_base_term (rtx x)
{
cselib_val *val;
- struct elt_loc_list *l;
+ struct elt_loc_list *l, *f;
+ rtx ret;
#if defined (FIND_BASE_TERM)
/* Try machine-dependent ways to find the base term. */
@@ -1591,12 +1592,26 @@ find_base_term (rtx x)
case VALUE:
val = CSELIB_VAL_PTR (x);
+ ret = NULL_RTX;
+
if (!val)
- return 0;
- for (l = val->locs; l; l = l->next)
- if ((x = find_base_term (l->loc)) != 0)
- return x;
- return 0;
+ return ret;
+
+ f = val->locs;
+ /* Temporarily reset val->locs to avoid infinite recursion. */
+ val->locs = NULL;
+
+ for (l = f; l; l = l->next)
+ if (GET_CODE (l->loc) == VALUE
+ && CSELIB_VAL_PTR (l->loc)->locs
+ && !CSELIB_VAL_PTR (l->loc)->locs->next
+ && CSELIB_VAL_PTR (l->loc)->locs->loc == x)
+ continue;
+ else if ((ret = find_base_term (l->loc)) != 0)
+ break;
+
+ val->locs = f;
+ return ret;
case LO_SUM:
/* The standard form is (lo_sum reg sym) so look only at the