On 9/22/24 7:00 AM, Mikael Pettersson wrote:
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.
THanks.  I've pushed this to the trunk.
jeff

Reply via email to