Commit 8fc6f12f by Richard Guenther Committed by Richard Biener

tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use…

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
parent 35f4c4ee
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> 2007-09-08 Uros Bizjak <ubizjak@gmail.com>
PR target/33329 PR target/33329
...@@ -3770,22 +3770,23 @@ verify_gimple_expr (tree expr) ...@@ -3770,22 +3770,23 @@ verify_gimple_expr (tree expr)
case ADDR_EXPR: case ADDR_EXPR:
{ {
tree op = TREE_OPERAND (expr, 0); tree op = TREE_OPERAND (expr, 0);
tree ptr_type;
if (!is_gimple_addressable (op)) if (!is_gimple_addressable (op))
{ {
error ("invalid operand in unary expression"); error ("invalid operand in unary expression");
return true; return true;
} }
ptr_type = build_pointer_type (TREE_TYPE (op)); if (TYPE_POINTER_TO (TREE_TYPE (op))
if (!useless_type_conversion_p (type, ptr_type) && !useless_type_conversion_p (type,
TYPE_POINTER_TO (TREE_TYPE (op)))
/* FIXME: a longstanding wart, &a == &a[0]. */ /* FIXME: a longstanding wart, &a == &a[0]. */
&& (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
|| !useless_type_conversion_p (type, || (TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))
build_pointer_type (TREE_TYPE (TREE_TYPE (op)))))) && !useless_type_conversion_p (type,
TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))))))
{ {
error ("type mismatch in address expression"); error ("type mismatch in address expression");
debug_generic_stmt (TREE_TYPE (expr)); debug_generic_stmt (TREE_TYPE (expr));
debug_generic_stmt (ptr_type); debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op)));
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment