diff options
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 41fcabfc0eb..6368ddf8266 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -2024,7 +2024,7 @@ find_bswap_or_nop_load (gimple *stmt, tree ref, struct symbolic_number *n) offset from base to compare to other such leaf node. */ HOST_WIDE_INT bitsize, bitpos; machine_mode mode; - int unsignedp, volatilep; + int unsignedp, reversep, volatilep; tree offset, base_addr; /* Not prepared to handle PDP endian. */ @@ -2035,7 +2035,7 @@ find_bswap_or_nop_load (gimple *stmt, tree ref, struct symbolic_number *n) return false; base_addr = get_inner_reference (ref, &bitsize, &bitpos, &offset, &mode, - &unsignedp, &volatilep, false); + &unsignedp, &reversep, &volatilep, false); if (TREE_CODE (base_addr) == MEM_REF) { @@ -2074,6 +2074,8 @@ find_bswap_or_nop_load (gimple *stmt, tree ref, struct symbolic_number *n) return false; if (bitsize % BITS_PER_UNIT) return false; + if (reversep) + return false; if (!init_symbolic_number (n, ref)) return false; @@ -2522,11 +2524,11 @@ bswap_replace (gimple *cur_stmt, gimple *src_stmt, tree fndecl, { HOST_WIDE_INT bitsize, bitpos; machine_mode mode; - int unsignedp, volatilep; + int unsignedp, reversep, volatilep; tree offset; get_inner_reference (src, &bitsize, &bitpos, &offset, &mode, - &unsignedp, &volatilep, false); + &unsignedp, &reversep, &volatilep, false); if (n->range < (unsigned HOST_WIDE_INT) bitsize) { load_offset = (bitsize - n->range) / BITS_PER_UNIT; |