https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99540
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Sandiford <[email protected]>: https://gcc.gnu.org/g:d7cea7ceff9a2be7436108030c598628c51fba0f commit r11-7787-gd7cea7ceff9a2be7436108030c598628c51fba0f Author: Richard Sandiford <[email protected]> Date: Tue Mar 23 14:02:03 2021 +0000 aarch64: Make aarch64_add_offset work with -ftrapv [PR99540] aarch64_add_offset uses expand_mult to multiply the SVE VL by an out-of-range constant. expand_mult takes an argument to indicate whether the multiplication is signed or unsigned, but in this context the multiplication is effectively signless and so the choice seemed arbitrary. However, one of the things that the signedness input does is indicate whether signed overflow should be trapped for -ftrapv. We don't want that here, so we must treat the multiplication as unsigned. gcc/ 2021-03-23 Jakub Jelinek <[email protected]> PR target/99540 * config/aarch64/aarch64.c (aarch64_add_offset): Tell expand_mult to perform an unsigned rather than a signed multiplication. gcc/testsuite/ 2021-03-23 Richard Sandiford <[email protected]> PR target/99540 * gcc.dg/vect/pr99540.c: New test.
