This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51634] New: [OOP] ICE with polymorphic operators
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Dec 2011 08:21:05 +0000
- Subject: [Bug fortran/51634] New: [OOP] ICE with polymorphic operators
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51634
Bug #: 51634
Summary: [OOP] ICE with polymorphic operators
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Depends on: 46328, 51334
Related to PR 51334 and PR 46328, though the error message is slightly
different.
foo.f90:37:0: internal compiler error: tree check: expected function_type or
method_type, have pointer_type in gimplify_call_expr, at gimplify.c:2430
module field_module
implicit none
private
public :: field
type :: field
real, allocatable :: f(:)
contains
procedure :: multiply_real => multiply
procedure :: copy => copy_field
generic :: operator(*) => multiply_real
generic :: assignment(=) => copy
end type
contains
subroutine copy_field (lhs, rhs)
class(field), intent(inout) :: lhs
class(field), intent(in) :: rhs
lhs%f = rhs%f
end subroutine
function multiply(lhs,rhs)
class(field) ,intent(in) :: lhs
real ,intent(in) :: rhs
class(field) ,allocatable :: multiply
allocate(multiply)
multiply%f = lhs%f * rhs
end function
end module field_module
program main
use field_module
implicit none
type(field) :: f, g
real :: dt, half
dt = 7
half = 0.5
f = g * dt * half
end program main