http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52013
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-30 13:57:12 UTC --- Untested patch. Note: It will change the ABI for GCC 4.6 programs, but only if the used module and type names are together > 47 characters long. It will also change the ABI for polymorphic arrays (4.7 feature), thus, it should go in before 4.7 is released. --- class.c (revision 183722) +++ class.c (working copy) @@ -296,4 +296,6 @@ get_unique_hashed_string (char *string, /* If string is too long, use hash value in hex representation (allow for - extra decoration, cf. gfc_build_class_symbol & gfc_find_derived_vtab). */ - if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 11) + extra decoration, cf. gfc_build_class_symbol & gfc_find_derived_vtab). + We need space to for 15 characters "__class_" + symbol name + "_%d_%da", + where %d is the (co)rank which can be up to n = 15. */ + if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 15) { @@ -362,6 +364,6 @@ gfc_build_class_symbol (gfc_typespec *ts get_unique_hashed_string (tname, ts->u.derived); - if ((*as) && (*as)->rank && attr->allocatable) - sprintf (name, "__class_%s_%d_a", tname, (*as)->rank); - else if ((*as) && (*as)->rank) - sprintf (name, "__class_%s_%d", tname, (*as)->rank); + if ((*as) && attr->allocatable) + sprintf (name, "__class_%s_%d_%da", tname, (*as)->rank, (*as)->corank); + else if ((*as)) + sprintf (name, "__class_%s_%d_%d", tname, (*as)->rank, (*as)->corank); else if (attr->pointer)