This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR fortran/37319


Eric Botcazou wrote:
Hi,

there is one remaining regression in the Fortran testsuite on SPARC/Solaris

FAIL: gfortran.dg/function_kinds_5.f90 -O (test for errors, line 8)

The expected error message is not issued by the compiler. Recompile the latter at -O0 and the message is correctly issued.

The problem is that, during the compilation of the testcase, the string 'name' in parse.c:match_deferred_characteristics is used uninitialized:

/* Set the function locus correctly. If we have not found the
function name, there is an error. */
gfc_match ("function% %n", name);
if (m == MATCH_YES && strcmp (name, gfc_current_block ()->name) == 0)
{
gfc_current_block ()->declared_at = gfc_current_locus;
gfc_commit_symbols ();
}
else
gfc_error_check ();


gfc_match ("function% %n", name) doesn't touch 'name' so the outcome of the
string comparison is random.


Proposed fix attached, tested on SPARC/Solaris, OK for mainline?


Reg tested on x86-64-gnu-linux. OK. Thanks for patch.


Jerry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]