From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6 Description of problem: This is a report to Fedora Core 4 of the bug which is also at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18518. The basic problem is that in code like the following: subroutine foo integer g, h save g equivalence (g,h) the value of h is not SAVE'd. Version-Release number of selected component (if applicable): gcc-gfortran-4.0.1-4.fc4 How reproducible: Always Steps to Reproduce: 1. Create the following routine foo.f90: subroutine foo integer i,g,h data i/0/ equivalence (g,h) save g if (i == 0) then i = 1 h = 12345 end if print *,h end subroutine foo 2. Compile with "gfortran -S foo.f90" 3. Look at assembly output f90.s. Actual Results: The value 12345 is being put into a stack location. Expected Results: The value 12345 should be put into the same memory location occupied by the variable g. Additional info:
Fixed in GCC HEAD: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01735.html and approved for 4.0.x when it reopens.