https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68401
Bug ID: 68401
Summary: improve 'Allocation would exceed memory limit'
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: Joost.VandeVondele at mat dot ethz.ch
Target Milestone: ---
as an enhancement, it would be very nice if the error message:
'Allocation would exceed memory limit'
could be improved to read
'Allocation of XXXX bytes would exceed memory limit'
in the out of memory message. This would help users and/or developers to take
the right actions.
Testcase:
> cat test.f90
INTEGER, PARAMETER :: N=2**30
INTEGER, POINTER :: data(:)
ALLOCATE(data(N))
END
> ulimit -v 200000 && gfortran -g test.f90 && ./a.out
Operating system error: Cannot allocate memory
Allocation would exceed memory limit
Error termination. Backtrace:
#0 0x40078b in MAIN__
at /data/vjoost/gnu/bugs/test.f90:3
#1 0x4007ea in main
at /data/vjoost/gnu/bugs/test.f90:4
The error message is constructed in trans.c and there is obviously a 'tree
size' nearby, but I didn't see how to get that in the error string.