[Patch, fortran] PR28908 - [4.1/4.2 Regression]: fold_convert fails for Fortran operator
THOMAS Paul Richard 169137
Paul.Richard.THOMAS@cea.fr
Mon Sep 4 13:49:00 GMT 2006
Well, it is now a double defeat; I really though that I had it
sorted with last friday's posting. *sigh*
To fix all of the problems in this PR, I have restored the backstop
association of derived types in trans-types.c and have fixed all of
the problems within that framework; no more messing around in
symbol.c!
(i) In adding derived types to the derived type list, a check is now
made for multiple entries of the same symbol. I was astonished to
find that some were appearing 3 times or more. This fixes nothing
but produces cleaner and shorter lists.
(ii) Module functions that return a derived type are now checked to
make sure that the module specification block version of the type
is used. This fixes used_types_3.f90
(iii) For some reason that I cannot discern from my notes of the
time, only non-module derived types were built in the parent name-
space and the backend declaration of module types were used as they
came. used_types_3.f90 is an example, where the backend decl. is
NULL and should be built. Raising the restriction fixed this and
broke nothing.
(iv) The backend declaration is added to sibling namespaces, where
and equal type is found, as well as to the types own namespace.
This fixes the modified version of derived_init_2.f90
The three 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 and that every last one of the PRs and their offshoots
remain fixed.
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.
Paul
2006-09-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28908
REGRESSION FIX
* 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. Modify the
restored code so that a check is made to see if the symbol is
already in the list.
(resolve_fntype): Make sure that the specification block
version of the derived type is used for a module function that
returns that type.
* 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.
Modify the restored code such that all derived types are built
if their symbols are found in the parent namespace; not just
non-module types. Add backend_decls to like derived types in
sibling namespaces, as well as that of the derived type.
2006-09-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28908
* gfortran.dg/used_types_7.f90: New test.
* gfortran.dg/used_types_8.f90: New test.
* gfortran.dg/used_types_9.f90: New test.
<<revert.diff>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revert.diff
Type: application/octet-stream
Size: 17957 bytes
Desc: revert.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060904/818ff4eb/attachment.obj>
More information about the Fortran
mailing list