aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-ssa-store-merging.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index e7c90ba..a00370e 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -871,12 +871,18 @@ find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
{
mask = ((uint64_t) 1 << (rsize * BITS_PER_MARKER)) - 1;
*cmpxchg &= mask;
- *cmpnop >>= (n->range - rsize) * BITS_PER_MARKER;
+ if (n->range - rsize == sizeof (int64_t))
+ *cmpnop = 0;
+ else
+ *cmpnop >>= (n->range - rsize) * BITS_PER_MARKER;
}
else
{
mask = ((uint64_t) 1 << (rsize * BITS_PER_MARKER)) - 1;
- *cmpxchg >>= (n->range - rsize) * BITS_PER_MARKER;
+ if (n->range - rsize == sizeof (int64_t))
+ *cmpxchg = 0;
+ else
+ *cmpxchg >>= (n->range - rsize) * BITS_PER_MARKER;
*cmpnop &= mask;
}
n->range = rsize;