https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77971
--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> --- For completeness, compiles without variable "g" : $ cat z3.f90 module m contains function f() f = 1 entry g() g = 2 end end $ gfortran-7-20161009 -O0 -c z3.f90 Problem detected with variable named "f" : $ cat z4.f90 module m real f contains function f() f = 1 entry g() g = 2 end end $ gfortran-7-20161009 -O0 -c z4.f90 z4.f90:4:13: z4.f90:2:9: real f 2 z4.f90:4:13: function f() 1 Error: Procedure 'f' at (1) has an explicit interface and must not have attributes declared at (2)