[Patch, fortran] PR29539 and PR29634 - derived_types without a proc_name causing an ICE.

Paul Thomas paulthomas2@wanadoo.fr
Sun Nov 5 21:35:00 GMT 2006


:ADDPATCH fortran:

Both these PRs are associated with an ICE at the the same line in decl.c 
because the derived types being tested for an error do not have a proc_name.

The first part of the fix is "obvious" - exclude these derived types 
because the error does not apply to them.

However, the testcase for PR29634 is invalid code because it contains an 
interface for a contained function.  This is detected 
gfc_match_function_decl and an appropriate error stacked away.  However, 
the parser presses on here, just in case another matcher works and 
gfc_match_data_decl comes close to doing so.  However, in returning 
MATCH_ERROR, it produces its own error, which overwrites the original 
with one complaining about the syntax.  In order to fix this, I have 
added a new function to test the error buffer flag.  If this is set, the 
new syntax error is not emitted and the old one retained.

Regtested on Cygwin_NT/amd64 - OK for trunk, 4.2 and 4.1?

Paul

2006-10-31  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/29539
    PR fortran/29634
    * decl.c (variable_decl): Add test for presence of proc_name.
    * error.c (gfc_error_flag_test): New function.
    * gfortran.h : Prototype for gfc_error_flag_test.

2006-11-05  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/29539
    * gfortran.dg/gfortran.dg/blockdata_3.f90: New test.

    PR fortran/29634
    * gfortran.dg/gfortran.dg/derived_function_interface_1.f90: New test.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr29539.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061105/e649f943/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061105/e649f943/attachment-0001.ksh>


More information about the Gcc-patches mailing list