diff options
author | Martin Jambor <mjambor@suse.cz> | 2023-11-06 17:04:33 +0100 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2023-11-06 17:05:46 +0100 |
commit | e15dd9a04814af45a66ae4114aa16b1c11aae2ec (patch) | |
tree | 46e2e4e8be6e1326e68220689be89fee00c1868f /gcc/fortran/trans-decl.cc | |
parent | ecd755a91d5797dd210795c69594fb4dac3ac0e5 (diff) | |
download | gcc-e15dd9a04814af45a66ae4114aa16b1c11aae2ec.zip gcc-e15dd9a04814af45a66ae4114aa16b1c11aae2ec.tar.gz gcc-e15dd9a04814af45a66ae4114aa16b1c11aae2ec.tar.bz2 |
Fortran: Fix generate_error library function fnspec
when developing an otherwise unrelated patch I've discovered that the
fnspec for the Fortran library function generate_error is wrong. It is
currently ". R . R " where the first R describes the first parameter
and means that it "is only read and does not escape." The function
itself, however, with signature:
bool
generate_error_common (st_parameter_common *cmp, int family, const char *message)
contains the following:
/* Report status back to the compiler. */
cmp->flags &= ~IOPARM_LIBRETURN_MASK;
which does not correspond to the fnspec and breaks testcase
gfortran.dg/large_unit_2.f90 when my patch is applied, since it tries
to re-use the flags from before the call.
This patch replaces the "R" with "W" which stands for "specifies that
the memory pointed to by the parameter does not escape."
gcc/fortran/ChangeLog:
2023-11-02 Martin Jambor <mjambor@suse.cz>
* trans-decl.cc (gfc_build_builtin_function_decls): Fix fnspec of
generate_error.
Diffstat (limited to 'gcc/fortran/trans-decl.cc')
-rw-r--r-- | gcc/fortran/trans-decl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index a3f037b..b86cfec 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -3821,7 +3821,7 @@ gfc_build_builtin_function_decls (void) void_type_node, -2, pchar_type_node, pchar_type_node); gfor_fndecl_generate_error = gfc_build_library_function_decl_with_spec ( - get_identifier (PREFIX("generate_error")), ". R . R ", + get_identifier (PREFIX("generate_error")), ". W . R ", void_type_node, 3, pvoid_type_node, integer_type_node, pchar_type_node); |