aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2023-06-07 23:40:56 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2023-06-07 23:40:56 +0100
commite73a307f5027aeb124fa824621ad980aa983931b (patch)
tree25d35946ade7ea2768852b9dd177bf43de74a2f0 /libgcc
parenteba3565ce6d766c006cbf1f7f293bbd1226a682d (diff)
downloadgcc-e73a307f5027aeb124fa824621ad980aa983931b.zip
gcc-e73a307f5027aeb124fa824621ad980aa983931b.tar.gz
gcc-e73a307f5027aeb124fa824621ad980aa983931b.tar.bz2
[Committed] Bug fix to new wi::bitreverse_large function.
Richard Sandiford was, of course, right to be warry of new code without much test coverage. Converting the nvptx backend to use the BITREVERSE rtx infrastructure, has resulted in far more exhaustive testing and revealed a subtle bug in the new wi::bitreverse implementation. The code needs to use HOST_WIDE_INT_1U (instead of 1) to avoid unintended sign extension. This patch has been tested on nvptx-none hosted on x86_64-pc-linux-gnu (with a minor tweak to use BITREVERSE), where it fixes regressions of the 32-bit test vectors in gcc.target/nvptx/brev-2.c and the 64-bit test vectors in gcc.target/nvptx/brevll-2.c. Committed as obvious. 2023-06-07 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * wide-int.cc (wi::bitreverse_large): Use HOST_WIDE_INT_1U to avoid sign extension/undefined behaviour when setting each bit.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions