Hide Forgot
Description of problem: If the compiler flags "-finit-local-zero" and "-fno-automatic" are both used, gfortran will spit out an error like this: Error: Function result 'h' at (1) cannot have an initializer This does not happen if the function does not use the "result" attribute (that is, the result name is the same as the function name). Version-Release number of selected component (if applicable): GNU Fortran (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) How reproducible: Always Steps to Reproduce: 1. Create the following file (call it hello.f90, for example): program inittest contains function hello (a) result (h) integer :: h h = 1 end function hello end program inittest 2. gfortran -finit-local-zero -fno-automatic hello.f90 Actual results: Error: Function result 'h' at (1) cannot have an initializer Expected results: Compiles as usual. Additional info: If you change "h" to "hello" and omit the "result (h)" part, it works fine.
Tracking this upstream.