diff options
author | Richard Biener <rguenther@suse.de> | 2020-01-09 10:29:54 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2020-01-09 10:29:54 +0000 |
commit | 0f507a365777b403cf058ee1208bf41a7363a728 (patch) | |
tree | 2ac67cd46c37d7d68318fff8b178482191736862 /gcc/gimple-ssa-store-merging.c | |
parent | ddc8786f8ebe5c97331cbbeef15c99e4878e669e (diff) |
re PR tree-optimization/93040 (gcc doesn't optimize unaligned accesses to a 16-bit value on the x86 as well as it does a 32-bit value (or clang))
2020-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/93040
* gimple-ssa-store-merging.c (find_bswap_or_nop): Raise search limit.
* gcc.dg/optimize-bswaphi-1.c: Amend.
* gcc.dg/optimize-bswapsi-2.c: Likewise.
From-SVN: r280034
Diffstat (limited to 'gcc/gimple-ssa-store-merging.c')
-rw-r--r-- | gcc/gimple-ssa-store-merging.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index 0d7639c9dca..741b1ec039c 100644 --- a/gcc/gimple-ssa-store-merging.c +++ b/gcc/gimple-ssa-store-merging.c @@ -848,11 +848,11 @@ find_bswap_or_nop (gimple *stmt, struct symbolic_number *n, bool *bswap) { /* The last parameter determines the depth search limit. It usually correlates directly to the number n of bytes to be touched. We - increase that number by log2(n) + 1 here in order to also + increase that number by 2 * (log2(n) + 1) here in order to also cover signed -> unsigned conversions of the src operand as can be seen in libgcc, and for initial shift/and operation of the src operand. */ int limit = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (gimple_expr_type (stmt))); - limit += 1 + (int) ceil_log2 ((unsigned HOST_WIDE_INT) limit); + limit += 2 * (1 + (int) ceil_log2 ((unsigned HOST_WIDE_INT) limit)); gimple *ins_stmt = find_bswap_or_nop_1 (stmt, n, limit); if (!ins_stmt) |