]> git.ipfire.org Git - thirdparty/gcc.git/commit - libgcc/ChangeLog
re PR target/82274 (__builtin_mul_overflow fails to detect overflow for int64_t when...
authorJakub Jelinek <jakub@redhat.com>
Fri, 13 Oct 2017 17:19:12 +0000 (19:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 13 Oct 2017 17:19:12 +0000 (19:19 +0200)
commite7176f75d6b2dd56059dad5920c770dade79df95
tree7ac0495b4cd1c60e5a022d19c0de3ce667bdd725
parent8de7190350263d381df5c12cfbbfb4191b8d3973
re PR target/82274 (__builtin_mul_overflow fails to detect overflow for int64_t when compiled with -m32)

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.

From-SVN: r253734
gcc/ChangeLog
gcc/internal-fn.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr82274-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr82274-2.c [new file with mode: 0644]
libgcc/ChangeLog
libgcc/libgcc2.c