This is the mail archive of the 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] PR28908 - [4.1/4.2 Regression]: fold_convert fails for Fortran operator

:ADDPATCH fortran:

Well, I have finally had to admit defeat! I have wrestled all week
with derived types in interfaces and have wasted more time than I
care to think about.  The moment that I abandoned having a single,
one-stop-does-all call in symbol.c and started fixing things up in
resolve.c, I knew the game was up....

To fix both of the problems in this PR, I have restored the backstop
association of derived types in trans-types.c.  I have retained all
the improvements to symbol.c(gfc_use_derived) because they greatly
reduce the number of fixups that trans-types.c has to do.  In fact,
I think that it is only interfaces that require this treatment now.

Ideally, the final association process should be shifted from
trans-decl.c to resolve.c but I could not immediately identify a
single point where all the references arrived for checking. The
PR has attached a kludge that partially addressed the problem of
interfaces but it still suffered a residual regression(used_types_8).

Another improvement that would be worthwhile and, possibly in the
long run essential, would be a symtree of derived types in the top
level namespace, keyed on name and module. I will persist in trying
to get this right!

The two testcases were provide by HJ Lu and are extracted from
failing bits of one of the SPEC CPU 2006 tests. They exercise the
use of derived types in interfaces.

In fact, one good thing to come out of this business is that the
testing of the association of derived types is now enormously
enhanced.  Thank you to the two Martins and to HJ for bearing with
me and helping out with this series of regressions.

Regtested on Cygwin_NT/PIV.

I will commit tomorrow morning, upon getting a green light from HJ
that the SPEC CPU 2006 suite runs once more.


2006-09-01 Paul Thomas <>

	PR fortran/28908
	* gfortran.h : Restore the gfc_dt_list structure and reference
	to it in gfc_namespace.
	* resolve.c (resolve_fl_derived): Restore the building of the
	list of derived types for the current namespace.
	* symbol.c (gfc_free_dt_list): Restore.
	(gfc_free_namespace): Restore call to previous.
	* trans-types.c (copy_dt_decls_ifequal): Restore.
	(gfc_get_derived_type): Restore all the paraphenalia for
	association of derived types, including calls to previous.

2006-09-01 Paul Thomas <>

	PR fortran/28908
	* gfortran.dg/used_types_7.f90: New test.
	* gfortran.dg/used_types_8.f90: New test.

Attachment: revert.diff
Description: revert.diff

Attachment: Change.Logs
Description: Change.Logs

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