aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-09-08 12:16:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-09-08 12:16:58 +0000
commit8fc6f12f498676b90ee96f3488af0c59a74d4905 (patch)
tree140e39bfe14cc8390d0f13e1af84b0937b042d97 /gcc/tree-cfg.c
parent35f4c4eee129e596804ffe050f58aa92e59e3872 (diff)
downloadgcc-8fc6f12f498676b90ee96f3488af0c59a74d4905.zip
gcc-8fc6f12f498676b90ee96f3488af0c59a74d4905.tar.gz
gcc-8fc6f12f498676b90ee96f3488af0c59a74d4905.tar.bz2
tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_TO if available instead.
2007-09-08 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_TO if available instead. From-SVN: r128271
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 069d330..e41307b 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3770,22 +3770,23 @@ verify_gimple_expr (tree expr)
case ADDR_EXPR:
{
tree op = TREE_OPERAND (expr, 0);
- tree ptr_type;
if (!is_gimple_addressable (op))
{
error ("invalid operand in unary expression");
return true;
}
- ptr_type = build_pointer_type (TREE_TYPE (op));
- if (!useless_type_conversion_p (type, ptr_type)
+ if (TYPE_POINTER_TO (TREE_TYPE (op))
+ && !useless_type_conversion_p (type,
+ TYPE_POINTER_TO (TREE_TYPE (op)))
/* FIXME: a longstanding wart, &a == &a[0]. */
&& (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
- || !useless_type_conversion_p (type,
- build_pointer_type (TREE_TYPE (TREE_TYPE (op))))))
+ || (TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))
+ && !useless_type_conversion_p (type,
+ TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))))))
{
error ("type mismatch in address expression");
debug_generic_stmt (TREE_TYPE (expr));
- debug_generic_stmt (ptr_type);
+ debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op)));
return true;
}