tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_T...
authorRichard Guenther <rguenther@suse.de>
Sat, 8 Sep 2007 12:16:58 +0000 (12:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 8 Sep 2007 12:16:58 +0000 (12:16 +0000)
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

gcc/ChangeLog
gcc/tree-cfg.c

index 9366bc26a5ce2b37943caddf76cd8f89102f3252..10fe2e86d6d6e1331710ebdfa912daf12d50aa43 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2007-09-08  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/33329
index 069d330e74d3fbce244c7dc59aaff224a57f3453..e41307b6ed53c4b03930c2b580555a9d0da185f2 100644 (file)
@@ -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;
          }