Bug 168252 - gfortran does not SAVE EQUIVALENCE variables
Summary: gfortran does not SAVE EQUIVALENCE variables
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-09-13 22:35 UTC by Stephen Walton
Modified: 2007-11-30 22:11 UTC (History)
0 users

Clone Of:
Last Closed: 2005-09-27 21:50:44 UTC

Attachments (Terms of Use)

Description Stephen Walton 2005-09-13 22:35:10 UTC
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 21:50:44 UTC
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.