diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2019-08-17 08:45:37 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2019-08-17 08:45:37 +0300 |
commit | d74a8b0579edd0c42921eccc45ab986d24f2fef0 (patch) | |
tree | 2059efcc45ffef85dfef605dcc8b39c8765e07bd /gcc/fortran/trans-decl.c | |
parent | 777c02825229f14cf91c6044827ea42a77ded4a3 (diff) | |
download | gcc-d74a8b0579edd0c42921eccc45ab986d24f2fef0.zip gcc-d74a8b0579edd0c42921eccc45ab986d24f2fef0.tar.gz gcc-d74a8b0579edd0c42921eccc45ab986d24f2fef0.tar.bz2 |
PR fortran/68401 Improve allocation error message
Improve the error message that is printed when a memory allocation
fails, by including the location, and the size of the allocation that
failed.
Regtested on x86_64-pc-linux-gnu.
gcc/fortran/ChangeLog:
2019-08-17 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/68401
* trans-decl.c (gfc_build_builtin_function_decls): Replace
os_error with os_error_at decl.
* trans.c (trans_runtime_error_vararg): Modify so the error
function decl is passed directly.
(gfc_trans_runtime_error): Pass correct error function decl.
(gfc_trans_runtime_check): Likewise.
(trans_os_error_at): New function.
(gfc_call_malloc): Use trans_os_error_at.
(gfc_allocate_using_malloc): Likewise.
(gfc_call_realloc): Likewise.
* trans.h (gfor_fndecl_os_error): Replace with gfor_fndecl_os_error_at.
libgfortran/ChangeLog:
2019-08-17 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/68401
* gfortran.map: Add GFORTRAN_10 node, add _gfortran_os_error_at
symbol.
* libgfortran.h (os_error_at): New prototype.
* runtime/error.c (os_error_at): New function.
From-SVN: r274599
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 2a9b852..3c6ab60 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -102,7 +102,7 @@ tree gfor_fndecl_error_stop_string; tree gfor_fndecl_runtime_error; tree gfor_fndecl_runtime_error_at; tree gfor_fndecl_runtime_warning_at; -tree gfor_fndecl_os_error; +tree gfor_fndecl_os_error_at; tree gfor_fndecl_generate_error; tree gfor_fndecl_set_args; tree gfor_fndecl_set_fpe; @@ -3679,11 +3679,11 @@ gfc_build_builtin_function_decls (void) void_type_node, 3, pvoid_type_node, integer_type_node, pchar_type_node); - gfor_fndecl_os_error = gfc_build_library_function_decl_with_spec ( - get_identifier (PREFIX("os_error")), ".R", - void_type_node, 1, pchar_type_node); - /* The runtime_error function does not return. */ - TREE_THIS_VOLATILE (gfor_fndecl_os_error) = 1; + gfor_fndecl_os_error_at = gfc_build_library_function_decl_with_spec ( + get_identifier (PREFIX("os_error_at")), ".RR", + void_type_node, -2, pchar_type_node, pchar_type_node); + /* The os_error_at function does not return. */ + TREE_THIS_VOLATILE (gfor_fndecl_os_error_at) = 1; gfor_fndecl_set_args = gfc_build_library_function_decl ( get_identifier (PREFIX("set_args")), |