summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 6c71025b6b4..2c93c0e7c21 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1643,6 +1643,21 @@ build_one_cst (tree type)
}
}
+/* Return an integer of type TYPE containing all 1's in as much precision as
+ it contains, or a complex or vector whose subparts are such integers. */
+
+tree
+build_all_ones_cst (tree type)
+{
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tree scalar = build_all_ones_cst (TREE_TYPE (type));
+ return build_complex (type, scalar, scalar);
+ }
+ else
+ return build_minus_one_cst (type);
+}
+
/* Return a constant of arithmetic type TYPE which is the
opposite of the multiplicative identity of the set TYPE. */