Use __builtin_mul_overflow in xmallocarray
commit84d38abbc982db405cfe7a45ed53c64745da5511
authorJanne Blomqvist <jb@gcc.gnu.org>
Fri, 14 Jun 2019 16:05:54 +0000 (14 19:05 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Fri, 14 Jun 2019 16:05:54 +0000 (14 19:05 +0300)
tree03bfc61b8b6fe932def2e36c89dae37cbdaeefc9
parent66574c5374ecbd358e68d63922927fc03f2f232a
Use __builtin_mul_overflow in xmallocarray

As GCC now provides builtins for doing integer overflow checking, lets
use it when checking for overflow in xmallocarray.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2019-06-14  Janne Blomqvist  <jb@gcc.gnu.org>

* runtime/memory.c (SIZE_MAX):Remove macro definition.
(xmallocarray): Use __builtin_mul_overflow.

From-SVN: r272295
libgfortran/ChangeLog
libgfortran/runtime/memory.c