aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-common.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-09-11 07:13:25 +0200
committerTom de Vries <tdevries@suse.de>2020-09-11 07:27:56 +0200
commit5e044c673f8e7d473a2207cd3ba32910c4f5fc75 (patch)
tree7264d8140c269edddc43d605a816501766715353 /gcc/ggc-common.c
parent60e537a026c037d8f3e5678acd148f9e44b4fb9c (diff)
downloadgcc-5e044c673f8e7d473a2207cd3ba32910c4f5fc75.zip
gcc-5e044c673f8e7d473a2207cd3ba32910c4f5fc75.tar.gz
gcc-5e044c673f8e7d473a2207cd3ba32910c4f5fc75.tar.bz2
[nvptx] Fix UB in nvptx_assemble_value
When nvptx_assemble_value is called with size == 16, this bitshift runs into UB: ... val &= ((unsigned HOST_WIDE_INT)2 << (size * BITS_PER_UNIT - 1)) - 1; ... Fix this by checking the shift amount. Tested on nvptx. gcc/ChangeLog: * config/nvptx/nvptx.c (nvptx_assemble_value): Fix undefined behaviour.
Diffstat (limited to 'gcc/ggc-common.c')
0 files changed, 0 insertions, 0 deletions