This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] PATCH to copy_body_r
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2003 14:32:00 -0400
- Subject: [tree-ssa] PATCH to copy_body_r
This patch fixes some cases where we were introducing NOP_EXPRs in places
where they aren't valid; this is more of a problem with my upcoming patch
to make most ADDR_EXPRs valid 'val's, since a NOP_EXPR is not a val.
It also fixes a thinko which caused us to replace *& with just &.
Tested athlon-pc-linux-gnu, applied to tree-ssa.
2003-08-21 Jason Merrill <jason@redhat.com>
* tree-inline.c (copy_body_r): Don't convert when stripping &*.
Fix thinko in stripping *&.
*** tree-inline.c.~1~ 2003-08-21 12:19:36.000000000 -0400
--- tree-inline.c 2003-08-21 14:26:55.000000000 -0400
*************** copy_body_r (tree *tp, int *walk_subtree
*** 464,470 ****
value = (tree) n->value;
if (TREE_CODE (value) == INDIRECT_REF)
{
! *tp = convert (TREE_TYPE (*tp), TREE_OPERAND (value, 0));
return copy_body_r (tp, walk_subtrees, data);
}
}
--- 464,476 ----
value = (tree) n->value;
if (TREE_CODE (value) == INDIRECT_REF)
{
! /* Assume that the argument types properly match the
! parameter types. We can't compare them well enough
! without a comptypes langhook, and we don't want to
! call convert and introduce a NOP_EXPR to convert
! between two equivalent types (i.e. that only differ
! in use of typedef names). */
! *tp = TREE_OPERAND (value, 0);
return copy_body_r (tp, walk_subtrees, data);
}
}
*************** copy_body_r (tree *tp, int *walk_subtree
*** 483,489 ****
STRIP_NOPS (value);
if (TREE_CODE (value) == ADDR_EXPR)
{
! *tp = (tree) n->value;
return copy_body_r (tp, walk_subtrees, data);
}
}
--- 489,495 ----
STRIP_NOPS (value);
if (TREE_CODE (value) == ADDR_EXPR)
{
! *tp = TREE_OPERAND (value, 0);
return copy_body_r (tp, walk_subtrees, data);
}
}