summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-26 13:23:04 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-26 13:23:04 +0000
commita8cefe905b366aaa6b6af15a9f7124153ed18cf3 (patch)
tree0a7c596dcfad5b0a80e1635e57a2911b24a32034 /gcc/tree-cfg.c
parent9871fdfed7943cc4cc8fd2a4f1158de12a7ee7cc (diff)
downloadgcc-a8cefe905b366aaa6b6af15a9f7124153ed18cf3.tar.gz
2009-08-26 Richard Guenther <rguenther@suse.de>
PR middle-end/41163 * gimplify.c (gimplify_addr_expr): Canonicalize ADDR_EXPRs if the types to not match. * tree-cfg.c (verify_gimple_assign_single): Adjust ADDR_EXPR verification. * tree-ssa.c (useless_type_conversion_p): Conversions to pointers to unprototyped functions are useless. * gcc.c-torture/compile/pr41163.c: New testcase. * gcc.dg/pr35899.c: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 3b99d6c5a30..639c4ec710c 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3889,12 +3889,13 @@ verify_gimple_assign_single (gimple stmt)
return true;
}
- if (!one_pointer_to_useless_type_conversion_p (lhs_type,
- TREE_TYPE (op)))
+ if (!types_compatible_p (TREE_TYPE (op), TREE_TYPE (TREE_TYPE (rhs1)))
+ && !one_pointer_to_useless_type_conversion_p (TREE_TYPE (rhs1),
+ TREE_TYPE (op)))
{
error ("type mismatch in address expression");
- debug_generic_stmt (lhs_type);
- debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op)));
+ debug_generic_stmt (TREE_TYPE (rhs1));
+ debug_generic_stmt (TREE_TYPE (op));
return true;
}