http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46313

--- Comment #15 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-09 
18:42:52 UTC ---
(In reply to comment #14)
> However, GFC_MAX_SYMBOL_LEN is only:
>    GFC_MAX_SYMBOL_LEN*2+4 = 63*2+4 = 130 characters

Sorry, GFC_MAX_SYMBOL_LEN is only 63 characters. The other was trans.h's
GFC_MAX_MANGLED_SYMBOL_LEN. The symbols defined in gfortran.h have all a length
of "GFC_MAX_SYMBOL_LEN + 1". Thus, if you store the string in a normal
gfc_symbol->name you cannot be longer than 63 characters.

Maybe it is really time to use hashed strings? One could void them for strings
which are shorter and only hash for longer strings (starting with, e.g, a
capital letter to avoid clashes with non-hashed strings).

Note: If you add the symbol __class_%s_%d_a you already have used 13 characters
(for rank > 9) without the "get_unique_type_string" - thus the latter may only
be 50 characters long - that's two times 25 characters, which should be
normally enough. However, I could image automatically generated code, which is
longer. And with further nesting, you really start to have problems. Especially
with submodules, which can be nested infinite times.

Cf. gcc/cp/mangle.c for how C++ mangles the symbols.

Reply via email to