C { dg-options "-g -fno-globals -Wno-globals" } subroutine a(i) implicit none integer i i = 0 return end subroutine a(i) implicit none integer i i = 0 return end It seems that -fno-globals option happily allows compiling source which will not assemble later on and with -g causes ICE.
I can confirm this with almost all compilers but I do not know if this is ever going to be fixed in a 3.4.x compiler as g77 is dead (removed) on the mainline replaced by gfortran.
I should note that -fno-globals is saying that you do not want any globals at all but then you are using a global so this is invalid code and you are also saying do not check for globals (-fno-globals). Since I do not think this option is useful for gfortran at all. Closing as will not fix.