Bug 168252 - gfortran does not SAVE EQUIVALENCE variables
gfortran does not SAVE EQUIVALENCE variables
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-09-13 18:35 EDT by Stephen Walton
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.0.2-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-27 17:50:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stephen Walton 2005-09-13 18:35:10 EDT
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):

How reproducible:

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:
Comment 1 Jakub Jelinek 2005-09-27 17:50:44 EDT
Fixed in GCC HEAD:
and approved for 4.0.x when it reopens.

Note You need to log in before you can comment on or make changes to this bug.