+2004-02-04 Jan Hubicka <jh@suse.cz>
+
+ * alias.c (find_base_term, get_addr): Do not dereference NULL
+ pointer when all VALUE's locations has been invalidated.
+ (rtx_equal_for_memref_p): Simplify checking of VALUEs.
+
2004-02-03 Wolfgang Bangerth <bangerth@dealii.org>
* doc/invoke.texi (x86 options): Fix spelling/wording.
/* Some RTL can be compared without a recursive examination. */
switch (code)
{
- case VALUE:
- return CSELIB_VAL_PTR (x) == CSELIB_VAL_PTR (y);
-
case REG:
return REGNO (x) == REGNO (y);
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
/* There's no need to compare the contents of CONST_DOUBLEs or
case VALUE:
val = CSELIB_VAL_PTR (x);
+ if (!val)
+ return 0;
for (l = val->locs; l; l = l->next)
if ((x = find_base_term (l->loc)) != 0)
return x;
if (GET_CODE (x) != VALUE)
return x;
v = CSELIB_VAL_PTR (x);
- for (l = v->locs; l; l = l->next)
- if (CONSTANT_P (l->loc))
- return l->loc;
- for (l = v->locs; l; l = l->next)
- if (GET_CODE (l->loc) != REG && GET_CODE (l->loc) != MEM)
- return l->loc;
- if (v->locs)
- return v->locs->loc;
+ if (v)
+ {
+ for (l = v->locs; l; l = l->next)
+ if (CONSTANT_P (l->loc))
+ return l->loc;
+ for (l = v->locs; l; l = l->next)
+ if (GET_CODE (l->loc) != REG && GET_CODE (l->loc) != MEM)
+ return l->loc;
+ if (v->locs)
+ return v->locs->loc;
+ }
return x;
}