fix for the multiple-decl problem - please test
Tobias Burnus
burnus@net-b.de
Mon Jan 19 18:47:00 GMT 2009
Hi all,
Daniel Franke wrote:
>> Anyway, I am raising this question because your approach looks as if
>> it is entirely focussed on the multiple decl problem and that you will
>> attack the other issues separately, largely because you associate
>> external decls in the backend tree. Maybe you have some plan in mind
>> that I have not figured out? :-)
>>
> The plan is simple: make it work :)
>
I'm not sure whether it should be combined with that patch or whether it
should be a separate issue, but not only for declarations there is an
issue but also for TYPES (PR 38913):
Example:
CHARACTER(LEN=1) :: str1
contains
subroutine foo()
CHARACTER(LEN=1) :: str2
Here, str1 and str2 should be of the same type, but gfortran does not
mark them as such. As Richard noted (PR 38913), this causes problems
when doing an alias analysing. This can lead to wrong code (not
recognizing that two symbols point to the same variable) and to slower
code (for the same reason). On the trunk that is less of a problem, but
with the ALIAS-IMPROVEMENT branch, this causes real problems -
especially for array types (such as character strings). See also
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00939.html.
Regarding TYPE_CANONICAL, see:
http://gcc.gnu.org/onlinedocs/gccint/Types.html. Excerpt: "Canonical
types are used to improve performance in the C++ and Objective-C++ front
ends by allowing efficient comparison between two type nodes in
same_type_p: if the TYPE_CANONICAL values of the types are equal, the
types are equivalent; otherwise, the types are not equivalent. The
notion of equivalence for canonical types is the same as the notion of
type equivalence in the language itself." cf. also
SET_TYPE_STRUCTURAL_EQUALITY.
Tobias
More information about the Fortran
mailing list