aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-store-merging.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-ssa-store-merging.cc')
-rw-r--r--gcc/gimple-ssa-store-merging.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc
index 5a477c4..df7afd2 100644
--- a/gcc/gimple-ssa-store-merging.cc
+++ b/gcc/gimple-ssa-store-merging.cc
@@ -1614,7 +1614,7 @@ namespace {
then VAL represents the constant and all the other fields are zero, or
a memory load, then VAL represents the reference, BASE_ADDR is non-NULL
and the other fields also reflect the memory load, or an SSA name, then
- VAL represents the SSA name and all the other fields are zero, */
+ VAL represents the SSA name and all the other fields are zero. */
class store_operand_info
{
@@ -2309,6 +2309,10 @@ merged_store_group::apply_stores ()
if (buf_size <= MOVE_MAX)
string_concatenation = false;
+ /* String concatenation only works for byte aligned start and end. */
+ if (start % BITS_PER_UNIT != 0 || width % BITS_PER_UNIT != 0)
+ string_concatenation = false;
+
/* Create a power-of-2-sized buffer for native_encode_expr. */
if (!string_concatenation)
buf_size = 1 << ceil_log2 (buf_size);
@@ -3631,7 +3635,7 @@ split_group (merged_store_group *group, bool allow_unaligned_store,
/* For bswap framework using sets of stores, all the checking has been done
earlier in try_coalesce_bswap and the result always needs to be emitted
- as a single store. Likewise for string concatenation, */
+ as a single store. Likewise for string concatenation. */
if (group->stores[0]->rhs_code == LROTATE_EXPR
|| group->stores[0]->rhs_code == NOP_EXPR
|| group->string_concatenation)