[Bug fortran/89574] [7/8/9 Regression] internal compiler error: in conv_function_val, at fortran/trans-expr.c:3792
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89574 --- Comment #3 from Denis --- (In reply to Thomas Koenig from comment #2) > (In reply to Denis from comment #0) > > > The bug occurs when you have a module with some name (lets name it init) and > > it uses a module with an aliased subroutine or function with the same name > > (init) - see the attached source file. > > That is invalid, right? No, this is valid, because 'init' module doesn't use the module with this subroutine. It uses the module, in which this subroutine is aliased as 'test_init'. And the real 'init' subroutine is in another module. So, the module used in 'init' doesn't contain the 'init' subroutine directly and it is expected that 'init' module doesn't care about existence of this subroutine. See the source file for clarification. Also I think this must work even with directly aliased subroutine, like module init use test, test_init => init
[Bug fortran/89574] [7/8/9 Regression] internal compiler error: in conv_function_val, at fortran/trans-expr.c:3792
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89574 --- Comment #4 from Denis --- (In reply to Thomas Koenig from comment #2) > (In reply to Denis from comment #0) > > > The bug occurs when you have a module with some name (lets name it init) and > > it uses a module with an aliased subroutine or function with the same name > > (init) - see the attached source file. > > That is invalid, right? No, this is valid, because 'init' module doesn't use the module with this subroutine. It uses the module, in which this subroutine is aliased as 'test_init'. And the real 'init' subroutine is in another module. So, the module used in 'init' doesn't actually contain the 'init' subroutine and it is expected that 'init' module doesn't care about the existence of this subroutine. See the source file for clarification. Also I believe this must work even with directly aliased subroutine, like: module init use test, test_init => init ... ... end module init Because this is one of the reasons aliases exist: to prevent name conflicts.