diff options
author | Richard Guenther <rguenther@suse.de> | 2011-08-16 13:55:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-08-16 13:55:30 +0000 |
commit | 370f4759839b573d45ed86050d51564dcac629b7 (patch) | |
tree | ea6b5640fb50bd80de0488670f53e68836652312 /gcc/tree-cfg.c | |
parent | c50584186d58165c8cd3978712b5bfc18f18fcc5 (diff) | |
download | gcc-370f4759839b573d45ed86050d51564dcac629b7.zip gcc-370f4759839b573d45ed86050d51564dcac629b7.tar.gz gcc-370f4759839b573d45ed86050d51564dcac629b7.tar.bz2 |
tree.h (ptrofftype_p): New helper function.
2011-08-16 Richard Guenther <rguenther@suse.de>
* tree.h (ptrofftype_p): New helper function.
* tree-cfg.c (verify_expr): Use ptrofftype_p for POINTER_PLUS_EXPR
offset verification.
(verify_gimple_assign_binary): Likewise.
* tree.c (build2_stat): Likewise.
* tree-chrec.c (chrec_fold_plus_poly_poly): Likewise.
(reset_evolution_in_loop): Likewise.
* tree-chrec.h (build_polynomial_chrec): Likewise.
From-SVN: r177784
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 1207908..ea85959 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2772,13 +2772,11 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) error ("invalid operand to pointer plus, first operand is not a pointer"); return t; } - /* Check to make sure the second operand is an integer with type of - sizetype. */ - if (!useless_type_conversion_p (sizetype, - TREE_TYPE (TREE_OPERAND (t, 1)))) + /* Check to make sure the second operand is a ptrofftype. */ + if (!ptrofftype_p (TREE_TYPE (TREE_OPERAND (t, 1)))) { error ("invalid operand to pointer plus, second operand is not an " - "integer with type of sizetype"); + "integer type of appropriate width"); return t; } /* FALLTHROUGH */ @@ -3525,7 +3523,7 @@ verify_gimple_assign_binary (gimple stmt) do_pointer_plus_expr_check: if (!POINTER_TYPE_P (rhs1_type) || !useless_type_conversion_p (lhs_type, rhs1_type) - || !useless_type_conversion_p (sizetype, rhs2_type)) + || !ptrofftype_p (rhs2_type)) { error ("type mismatch in pointer plus expression"); debug_generic_stmt (lhs_type); |