https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82274
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Oct 13 17:26:28 2017 New Revision: 253735 URL: https://gcc.gnu.org/viewcvs?rev=253735&root=gcc&view=rev Log: PR target/82274 * internal-fn.c (expand_mul_overflow): If both operands have the same highpart of -1 or 0 and the topmost bit of lowpart is different, overflow is if res <= 0 rather than res < 0. * libgcc2.c (__mulvDI3): If both operands have the same highpart of -1 and the topmost bit of lowpart is 0, multiplication overflows even if both lowparts are 0. * gcc.dg/pr82274-1.c: New test. * gcc.dg/pr82274-2.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr82274-1.c branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr82274-2.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/internal-fn.c branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/libgcc/ChangeLog branches/gcc-7-branch/libgcc/libgcc2.c