aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2023-06-01 12:11:24 +0800
committerliuhongt <hongtao.liu@intel.com>2023-06-03 08:09:31 +0800
commit57b30f0134d9b49f7707b0c2ded6fd7686a312c8 (patch)
tree0dd7f495d4a14e6555bd8191dabd97dd27b54b1c /libgcc
parent49337040865269e13cdc2ead276d12ecb2e9f606 (diff)
downloadgcc-57b30f0134d9b49f7707b0c2ded6fd7686a312c8.zip
gcc-57b30f0134d9b49f7707b0c2ded6fd7686a312c8.tar.gz
gcc-57b30f0134d9b49f7707b0c2ded6fd7686a312c8.tar.bz2
Don't try bswap + rotate when TYPE_PRECISION(n->type) > n->range.
For the testcase in the PR, we have br64 = br; br64 = ((br64 << 16) & 0x000000ff00000000ull) | (br64 & 0x0000ff00ull); n->n: 0x3000000200. n->range: 32. n->type: uint64. The original code assumes n->range is same as TYPE PRECISION(n->type), and tries to rotate the mask from 0x300000200 -> 0x20300 which is incorrect. The patch fixed this bug by not trying bswap + rotate when TYPE_PRECISION(n->type) is not equal to n->range. gcc/ChangeLog: PR tree-optimization/110067 * gimple-ssa-store-merging.cc (find_bswap_or_nop): Don't try bswap + rotate when TYPE_PRECISION(n->type) > n->range. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110067.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions