summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-02 19:51:52 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-02 19:51:52 +0000
commitaa7e537c6a038e81382606468e484576c2cee3d5 (patch)
tree149b47cc2c398d20f882c4307d0f320170375137 /gcc/tree-ssa-math-opts.c
parent7f646368a7a7679a8c4a349c4130b49d9a64d9cd (diff)
parentb28b448fdb7865fc64094a799dd396f0d732a7c2 (diff)
downloadgcc-aa7e537c6a038e81382606468e484576c2cee3d5.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index aea8f386dca..27db5244d96 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1801,7 +1801,9 @@ find_bswap_1 (gimple stmt, struct symbolic_number *n, int limit)
if (rhs_class == GIMPLE_BINARY_RHS)
{
+ int i;
struct symbolic_number n1, n2;
+ unsigned HOST_WIDEST_INT mask;
tree source_expr2;
if (code != BIT_IOR_EXPR)
@@ -1827,6 +1829,15 @@ find_bswap_1 (gimple stmt, struct symbolic_number *n, int limit)
return NULL_TREE;
n->size = n1.size;
+ for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
+ {
+ unsigned HOST_WIDEST_INT masked1, masked2;
+
+ masked1 = n1.n & mask;
+ masked2 = n2.n & mask;
+ if (masked1 && masked2 && masked1 != masked2)
+ return NULL_TREE;
+ }
n->n = n1.n | n2.n;
if (!verify_symbolic_number_p (n, stmt))