I created PR93461 for this issue: The following code causes a bogus "symbol is already defined" error (using git commit 73380abd6b2783215c7950a2ade5e3f4b271e2bc): module aModuleWithAnAllowedName interface module subroutine aShortName() end subroutine aShortName end interface end module aModuleWithAnAllowedName submodule (aModuleWithAnAllowedName) aSubmoduleWithAVeryVeryVeryLongButEntirelyLegalName contains subroutine aShortName() call aSubroutineWithAVeryLongNameThatWillCauseAProblem() call aSubroutineWithAVeryLongNameThatWillCauseAProblemAlso() end subroutine aShortName subroutine aSubroutineWithAVeryLongNameThatWillCauseAProblem() end subroutine aSubroutineWithAVeryLongNameThatWillCauseAProblem subroutine aSubroutineWithAVeryLongNameThatWillCauseAProblemAlso() end subroutine aSubroutineWithAVeryLongNameThatWillCauseAProblemAlso end submodule aSubmoduleWithAVeryVeryVeryLongButEntirelyLegalName $ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/data001/abenson/Galacticus/Tools_Devel_Install/bin/../ libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-git/configure --prefix=/home/abenson/Galacticus/ Tools_Devel --enable-languages=c,c++,fortran --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.0.1 20200124 (experimental) (GCC) $ gfortran -c symlength.F90 -o symlength.o -ffree-line-length-none - frecursive -pthread -Wall -fbacktrace -ffpe-trap=invalid,zero,overflow -fdump- core -O3 -ffinite-math-only -fno-math-errno -fopenmp -g /tmp/cc8B4Hmp.s: Assembler messages: /tmp/cc8B4Hmp.s:20: Error: symbol `__amodulewithanallowedname.asubmodulewithaveryveryverylongbutentirelylegalname_MOD_asubroutinewithaverylongnamethatwillcauseaprobl' is already defined The problem occurs because GFC_MAX_MANGLED_SYMBOL_LEN is set to GFC_MAX_SYMBOL_LEN*2+4, which is sufficient for a module name plus function name (plus the additional "_"'s that get prepended), but insufficient if a submodule name is included. The name then gets truncated and can lead to two different functions having the same (truncated) symbol name. The fix is to increase this length to GFC_MAX_SYMBOL_LEN*3+5 - which allows for the submodule name plus the "." added between module and submodule names. I've attached a patch for this which includes a new test case for this PR. The patch regression tests cleanly. OK to commit? -Andrew -- * Andrew Benson: http://users.obs.carnegiescience.edu/abenson/contact.html * Galacticus: https://github.com/galacticusorg/galacticus