diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2013-06-13 10:21:01 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2013-06-13 08:21:01 +0000 |
commit | 5d418483049e504219c1f4bcebfa942863a8f75f (patch) | |
tree | 8f1f22ea52826b0983e2fe29263ca85cfbb146ae /gcc/tree.c | |
parent | 491f54a74b896005f70bdba66df495d91822b325 (diff) | |
download | gcc-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.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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. */ |