[patch, Fortran] Fix PR 60526, variable name has already been declared as a type
Thomas Koenig
tkoenig@netcologne.de
Sun Feb 14 17:33:00 GMT 2016
Am 14.02.2016 um 15:38 schrieb H.J. Lu:
> It breaks bootstrap on x86:
>
> ../../../src-trunk/libgfortran/intrinsics/selected_int_kind.f90:28:40:
>
> integer :: _gfortran_selected_int_kind
I have fixed this in two parts:
a) reverted the patch (r233411). I still managed to catch the revision
immediately following r233410. Thanks H.J. for the prompt report!
b) committed a fixed patch (r233413)
The problem was that there is no upcase equivalent for _, so the
test for a symbol with an upcase first letter found the symbol itself.
That fix was obvios, see attached patch.
I tested the new patch by regression-testing and by rebuilding
libgfortran.
I was unable to write a test case because I could not find a
set of options to allow a leading underscore in a function name.
So, should we do something differently? There are only seven
non-generated *.f90 files in libgfortran. The chances of
breaking bootstrap this way are relatively low, and patch
reversion is easy enough, so I don't think we should regularly
rebuild libgfortran for this.
Regards
Thomas
2016-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60526
* decl.c (build_sym): If the name has already been defined as a
type, it has a symtree with an upper case letter at the beginning.
If such a symtree exists, issue an error and exit. Don't do
this if there is no corresponding upper case letter.
2016-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60526
* gfortran.dg/type_decl_4.f90: Reinstated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p5.diff
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160214/066efcdc/attachment.bin>
More information about the Fortran
mailing list