This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: FW: [PATCH, FORTRAN] Class Name Clash
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 10 Apr 2014 10:50:24 +0200
- Subject: Re: FW: [PATCH, FORTRAN] Class Name Clash
- Authentication-results: sourceware.org; auth=none
Bernd Edlinger wrote:
> this patch fixes a recently discovered name-clash in gfc_build_class_symbol.
>
> Fortunately it is quite easy to fix: just make sure that the class names of target
> classes end with "_t", and target array classes end with "[0-9]t".
> This trick makes all names unique again.
One thing which in general doesn't make it as simple is that it breaks the ABI for
polymorphic variables.
However, as I have already broken the ABI for polymorphic variables in order to
support finalization (= destructors), doing another ABI breakage is no problem.
As we do break the ABI, we also switched to compressed .mod files - hence, most
code simply won't compile without recompiling the modules. Hence, there is no
problem form that side and the the ABI notice at
http://gcc.gnu.org/gcc-4.9/changes.html#fortran
should be sufficient.
Side note: I would really like if we could manage to create a GCC/gfortran
version 4.x which is .mod-ABI compatible with 4.(x-1) but so far we failed to
do so. And with the new array descriptor looming, either 4.9++ or 4.9+2 will
break the ABI again.
> I hope it is not too late, and this can still go into 4.9.0.
> Boot-Strapped without any regressions on x86_64-unknown-linux-gnu.
Regarding the patch: As Fortran is case insensitive, gfortran always stores
identifiers as lower case. Thus, using something uppercase prevents problems.
You also cannot blindly append characters as the values are fixed sized.
Would it do to replace the existant appended "p" (pointer) and "a" (allocatable)
by "P" and "A"? I think that should work as well and avoids the other issues.
Tobias