http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52606
Janne Blomqvist <jb at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> 2012-03-20 08:30:08 UTC --- (In reply to comment #1) > Ideally, we'd just accept long identifiers, but the maximum name length is > hard-coded (GFC_MAX_SYMBOL_LEN) and already way too large. I want to change > this to string pointers (probably using a string pool, maybe the GCC common > implementation, TBD). Like Steve says, the Fortran standard puts an upper limit on the length of valid identifiers. For F95 that's 31 characters, for newer standards this has been bumped up to 63, which is the reason for the value of the GFC_MAX_SYMBOL_LEN macro. So regardless of whether the strings are internally stored in statically or dynamically sized buffers, we need to generate an error for identifiers that exceed the limit. For BIND(C) binding labels, I did basically the change you're proposing, switching from static arrays to storing the labels in the symbol table. But that is slightly different, as bind(C) binding labels are not Fortran identifiers, and are thus allowed to be arbitrarily long. See PR 51808. Finally, before attacking static GFC_MAX_SYMBOL_LEN buffers, I suggest getting rid of static buffers of GFC_MAX_MANGLED_SYMBOL_LEN size. We should get rid of that macro altogether. Also, FWIW, the value for that macro is too small at the moment, as it's easy to construct examples were the mangled name exceeds that value. See e.g. PR 51802 for inspiration. ;-)