This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38907] New: ICE when contained function has same name as module function and used in expression
- From: "dick dot hendrickson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2009 21:21:26 -0000
- Subject: [Bug fortran/38907] New: ICE when contained function has same name as module function and used in expression
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program gives an internal compiler error. If the line
RDA = -1 is commented out, there is a different ICE. If the unary +
before the function reference in the assignment to RDA(1,2) is removed
the ICE goes away.
Dick Hendrickson
module sa0054_stuff
! fails on Windows XP
! gcc version 4.4.0 20081219 (experimental) [trunk revision 142842] (GCC)
contains
PURE FUNCTION S_REAL_SUM_I (A,B)
REAL :: S_REAL_SUM_I
REAL, INTENT(IN), OPTIONAL :: A,B
X = 0
S_REAL_SUM_I = X
END FUNCTION S_REAL_SUM_I
SUBROUTINE SA0054(RDA, NF10,nf1,nf2,nf3,nf4)
REAL RDA(NF10,NF10)
RDA = -1 !changes ICE if commented out
RDA(1,2) = + S_REAL_SUM_I(1.0,2.0)
! RDA(1,2) = S_REAL_SUM_I(1.0,2.0) !This one works
CONTAINS
PURE FUNCTION S_REAL_SUM_I (A,B)
REAL :: S_REAL_SUM_I
REAL, INTENT(IN), OPTIONAL :: A,B
S_REAL_SUM_I = 0
END FUNCTION S_REAL_SUM_I
END SUBROUTINE
end module sa0054_stuff
With RDA = -1
C:\gfortran>gfortran try_sa0054.f
f951.exe: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
With RDA = -1 commented out
C:\gfortran>gfortran try_sa0054.f
f951.exe: internal compiler error: in check_host_association, at
fortran/resolve
.c:4369
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: ICE when contained function has same name as module
function and used in expression
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dick dot hendrickson at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38907