This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/23515] New: ICE on correct code


[prt@localhost mytests]# cat foo.f90 program foo
  common /x/ a
  a = 1
  call bar ()
contains
  subroutine bar ()
    equivalence (a,b)
    print *, b
  end subroutine bar
end program foo
[prt@localhost mytests]# /gcc-4.0/bin/gfortran foo.f90
foo.f90: In function ?MAIN__?:
foo.f90:8: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[prt@localhost mytests]# cat foo*al
{
  union
  {
    real4 a;
  } equiv.0;
  real4 b;

  _gfortran_filename = "foo.f90";
  _gfortran_line = 8;
  _gfortran_ioparm.unit = 6;
  _gfortran_ioparm.list_format = 1;
  _gfortran_st_write ();
  _gfortran_transfer_real (&b, 4);
  _gfortran_st_write_done ();
}

Note, no MAIN. My mainline gets further but the equivalences are similarly
stuffed.  Declaring a and b before the equivalence, gives correct code.  I would
surmise, therefore, that match_equivalence needs to check that symbols exist for
each member of the equivalence group and that they are from the current scoping
unit.  If they are not, local symbols must be created.

Paul T

-- 
           Summary: ICE on correct code
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23515


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]