aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic-format-json.cc
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-09-10 15:54:14 +0200
committerTom de Vries <tdevries@suse.de>2020-09-10 21:30:33 +0200
commitaf47a2035a4882e6d4506e3d00b5a42414e3ee2b (patch)
tree84adb9201f74b952e64fe1c209f0bace9098420d /gcc/diagnostic-format-json.cc
parenta8f9b4c54cc350625accbb2c6b4005acb42d4c2e (diff)
downloadgcc-af47a2035a4882e6d4506e3d00b5a42414e3ee2b.zip
gcc-af47a2035a4882e6d4506e3d00b5a42414e3ee2b.tar.gz
gcc-af47a2035a4882e6d4506e3d00b5a42414e3ee2b.tar.bz2
[nvptx] Fix printing of 128-bit constant
Currently, for this code from c-c++-common/spec-barrier-1.c: ... __int128 g = 9; ... we generate: ... // BEGIN GLOBAL VAR DEF: g .visible .global .align 8 .u64 g[2] = { 9, 9 }; ... and consequently the test-case fails in execution. The problem is caused by a shift in nvptx_assemble_value: ... val >>= part * BITS_PER_UNIT; ... where the shift amount is equal to the number of bits in val, which is undefined behaviour. Fix this by detecting the situation and setting val to 0. Tested on nvptx. gcc/ChangeLog: PR target/97004 * config/nvptx/nvptx.c (nvptx_assemble_value): Handle shift by number of bits in shift operand.
Diffstat (limited to 'gcc/diagnostic-format-json.cc')
0 files changed, 0 insertions, 0 deletions