aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2013-06-13 10:21:01 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2013-06-13 08:21:01 +0000
commit5d418483049e504219c1f4bcebfa942863a8f75f (patch)
tree8f1f22ea52826b0983e2fe29263ca85cfbb146ae /gcc/tree.c
parent491f54a74b896005f70bdba66df495d91822b325 (diff)
downloadgcc-5d418483049e504219c1f4bcebfa942863a8f75f.zip
gcc-5d418483049e504219c1f4bcebfa942863a8f75f.tar.gz
gcc-5d418483049e504219c1f4bcebfa942863a8f75f.tar.bz2
tree-ssa-forwprop.c (simplify_bitwise_binary, [...]): Generalize to complex and vector.
2013-06-13 Marc Glisse <marc.glisse@inria.fr> gcc/ * tree-ssa-forwprop.c (simplify_bitwise_binary, associate_plusminus): Generalize to complex and vector. * tree.c (build_all_ones_cst): New function. * tree.h (build_all_ones_cst): Declare it. gcc/testsuite/ * gcc.dg/tree-ssa/forwprop-27.c: New testcase. From-SVN: r200059
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 6c71025..2c93c0e 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. */