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]

[Patch, fortran] PR29744 - [Regression] Type renaming crashes gfortran with excessive memory usage


:ADDPATCH fortran:

For once, I do not feel embarrassed by this type of PR: on Cygwin_NT, which I
used to develop the August round of patches, the compilation does not crash; it
just stops.  Since no errors are produced,  I proceeded on my merry
little way blissfully ignorant of the fact that there had been a
failure!

The reason that the testsuite does not pick it up on other systems is
that the test of the fix for PR19362 was moved to a subroutine, so
that other, connected aspects of association could be tested.  This
error only afflicts namespaces without a parent; eg. the main
programme.

The infinite loop comes about because, for other than derived types in
interfaces, the namespace of a proc_name is one and the same as the
namespace that owns the proc_name; ie. ns == ns->proc_name->ns.  This
being so, the namespace of the derived type is used to search for an
identical derived type. It rejects the same derived type in the search
but locks onto its renamed partner. Since this has no backend_decl, it
goes off and repeats the search... ad infinitum, or nearly so.  Why
compiler, running under Cygwin_NT stops silently, I do not know.

The ChangeLog comments adequately on the fix and the testcase is that
of PR19362, with nothing added.  Note that rather than identifying the
interface source, I have enforced ns != ns->proc_name->ns to directly
prevent the loop.

Regtests on Suse10.1/amd64 - OK for trunk, 4.2 and 4.1?

Thanks, Harald!

Paul

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

	PR fortran/29744
	* trans-types.c (gfc_get_derived_type): Ensure that the
	proc_name namespace is not the same as the owner namespace and
	that identical derived types in the same namespace share the
	same backend_decl.

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

	PR fortran/29744
	* gfortran.dg/used_types_12.f90: New test.

Attachment: pr29744.diff
Description: Text document

Attachment: Change.Logs
Description: Text document


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