https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65921
Bug ID: 65921 Summary: GFortran should use __builtin_mul_overflow when checking allocation sizes Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jb at gcc dot gnu.org Target Milestone: --- As of the GCC-5 release there is a new __builtin_mul_overflow builtin (https://gcc.gnu.org/gcc-5/changes.html ). GFortran could use this instead of the current overflow checks 1) In the frontend, code generated for the ALLOCATE statement. 2) In libgfortran/runtime/memory.c (xmallocarray).