From 8fc6f12f498676b90ee96f3488af0c59a74d4905 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sat, 8 Sep 2007 12:16:58 +0000 Subject: [PATCH] tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_TO if available instead. 2007-09-08 Richard Guenther * tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_TO if available instead. From-SVN: r128271 --- gcc/ChangeLog | 5 +++++ gcc/tree-cfg.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9366bc26a5c..10fe2e86d6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-09-08 Richard Guenther + + * tree-cfg.c (verify_gimple_expr): Avoid building new + pointer types, use TYPE_POINTER_TO if available instead. + 2007-09-08 Uros Bizjak PR target/33329 diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 069d330e74d..e41307b6ed5 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; } -- 2.30.2