This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch Ping] [RFC] Alias export patch
Hi,
Daniel Berlin wrote:
@@ -270,7 +270,8 @@ mem_attrs_htab_eq (const void *x, const
&& p->size == q->size && p->align == q->align
&& (p->expr == q->expr
|| (p->expr != NULL_TREE && q->expr != NULL_TREE
- && operand_equal_p (p->expr, q->expr, 0))));
+ && operand_equal_p (p->expr, q->expr, 0)))
+ && (p->orig_expr == q->orig_expr));
}
Errr, why isn't this check just like the one above it that uses
operand_equal_p?
I've hit an ICE in operand_equal_p when trying this, made a quick fix,
and later forgot to investigate. The below fix is tested with c-only
bootstrap on i686. The problem is that we've tried to save the original
exprs also for types, which we shouldn't do.
Andrey
--- emit-rtl.c.old 2006-03-15 00:43:32.000000000 +0300
+++ emit-rtl.c 2006-03-15 00:42:45.000000000 +0300
@@ -271,7 +271,9 @@ mem_attrs_htab_eq (const void *x, const
&& (p->expr == q->expr
|| (p->expr != NULL_TREE && q->expr != NULL_TREE
&& operand_equal_p (p->expr, q->expr, 0)))
- && (p->orig_expr == q->orig_expr));
+ && (p->orig_expr == q->orig_expr
+ || (p->orig_expr != NULL_TREE && q->orig_expr != NULL_TREE
+ && operand_equal_p (p->orig_expr, q->orig_expr, 0))));
}
/* Allocate a new mem_attrs structure and insert it into the hash table if
@@ -1473,7 +1475,7 @@ set_mem_attributes_minus_bitpos (rtx ref
{
HOST_WIDE_INT alias = MEM_ALIAS_SET (ref);
tree expr = MEM_EXPR (ref);
- tree orig_expr;
+ tree orig_expr = NULL;
rtx offset = MEM_OFFSET (ref);
rtx size = MEM_SIZE (ref);
unsigned int align = MEM_ALIGN (ref);
@@ -1534,6 +1536,8 @@ set_mem_attributes_minus_bitpos (rtx ref
if (! TYPE_P (t))
{
tree base;
+
+ orig_expr = cleanup_tree_from_conversions (t);
if (TREE_THIS_VOLATILE (t))
MEM_VOLATILE_P (ref) = 1;
@@ -1709,10 +1713,9 @@ set_mem_attributes_minus_bitpos (rtx ref
we're overlapping. */
offset = NULL;
expr = NULL;
+ orig_expr = NULL;
}
- orig_expr = cleanup_tree_from_conversions (t);
-
/* Now set the attributes we computed above. */
MEM_ATTRS (ref)
= get_mem_attrs (alias, expr, orig_expr, offset, size, align,