diff options
author | Max Ostapenko <m.ostapenko@partner.samsung.com> | 2015-02-06 10:17:07 +0400 |
---|---|---|
committer | Maxim Ostapenko <m.ostapenko@samsung.com> | 2016-04-11 14:10:32 +0300 |
commit | 7999e0626140eacdc02ba907ec0599d6def3f8f5 (patch) | |
tree | 50d05c61a114849433afeefcf2d5414e0447091b | |
parent | d5ffe6a7c859d33539c4f8a63a774afd2d4dde64 (diff) | |
download | linaro-gcc-7999e0626140eacdc02ba907ec0599d6def3f8f5.tar.gz linaro-gcc-7999e0626140eacdc02ba907ec0599d6def3f8f5.tar.bz2 linaro-gcc-7999e0626140eacdc02ba907ec0599d6def3f8f5.zip |
Add missing tree_int_cst_le function.
-rw-r--r-- | gcc/tree.c | 9 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index bec9d7b7aa9..d51b90f8270 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -6967,6 +6967,15 @@ tree_int_cst_lt (const_tree t1, const_tree t2) return INT_CST_LT_UNSIGNED (t1, t2); } +/* Nonzero if integer constants T1 and T2 represent values that satisfy <=. + The precise way of comparison depends on their data type. */ + +int +tree_int_cst_le (const_tree t1, const_tree t2) +{ + return tree_int_cst_lt (t1, t2) || tree_int_cst_equal (t1, t2); +} + /* Returns -1 if T1 < T2, 0 if T1 == T2, and 1 if T1 > T2. */ int diff --git a/gcc/tree.h b/gcc/tree.h index 2aafb89334c..c0c7c0fb2b8 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3654,6 +3654,7 @@ extern int attribute_list_equal (const_tree, const_tree); extern int attribute_list_contained (const_tree, const_tree); extern int tree_int_cst_equal (const_tree, const_tree); extern int tree_int_cst_lt (const_tree, const_tree); +extern int tree_int_cst_le (const_tree, const_tree); extern int tree_int_cst_compare (const_tree, const_tree); extern bool tree_fits_shwi_p (const_tree) #ifndef ENABLE_TREE_CHECKING |