aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-08-16 13:55:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-08-16 13:55:30 +0000
commit370f4759839b573d45ed86050d51564dcac629b7 (patch)
treeea6b5640fb50bd80de0488670f53e68836652312 /gcc/tree.h
parentc50584186d58165c8cd3978712b5bfc18f18fcc5 (diff)
downloadgcc-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.h')
-rw-r--r--gcc/tree.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index c8d292a..139c276 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5313,6 +5313,16 @@ truth_value_p (enum tree_code code)
|| code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
}
+/* Return whether TYPE is a type suitable for an offset for
+ a POINTER_PLUS_EXPR. */
+static inline bool
+ptrofftype_p (tree type)
+{
+ return (INTEGRAL_TYPE_P (type)
+ && TYPE_PRECISION (type) == TYPE_PRECISION (sizetype)
+ && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));
+}
+
/* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF. */
static inline tree
fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)