aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikael Pettersson <mikpelinux@gmail.com>2024-09-29 10:15:55 -0600
committerJeff Law <jlaw@ventanamicro.com>2024-09-29 10:15:55 -0600
commit0cd24b06d130d99bd86e5e03a01c38047413a92e (patch)
tree1d9a963a055ff2059fc7e18ee968a99d2dc84043 /include
parenta0f1f504b2c49a3695b91d3323d2e2419ef970db (diff)
downloadgcc-0cd24b06d130d99bd86e5e03a01c38047413a92e.zip
gcc-0cd24b06d130d99bd86e5e03a01c38047413a92e.tar.gz
gcc-0cd24b06d130d99bd86e5e03a01c38047413a92e.tar.bz2
[PATCH] [PATCH] Avoid integer overflow in gcc.dg/cpp/charconst-3.c (PR testsuite/116806)
The intermediate expression (unsigned char) '\234' * scale overflows int on int16 targets, causing the test case to fail there. Fixed by performing the arithmetic in unsigned type, as suggested by Andrew Pinski. Regression tested on x86_64-pc-linux-gnu, and on an out-of-tree 16-bit target with simulator. Manually checked the generated code for pdp11 and xstormy16. Ok for trunk? (I don't have commit rights so I'd need help committing it.) gcc/testsuite/ PR testsuite/116806 * gcc.dg/cpp/charconst-3.c: Perform arithmetic in unsigned type to avoid integer overflow.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions