public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51634] New: [OOP] ICE with polymorphic operators
@ 2011-12-20  8:57 burnus at gcc dot gnu.org
  2012-01-02 13:28 ` [Bug fortran/51634] " pault at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-20  8:57 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-19  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20  8:57 [Bug fortran/51634] New: [OOP] ICE with polymorphic operators burnus at gcc dot gnu.org
2012-01-02 13:28 ` [Bug fortran/51634] " pault at gcc dot gnu.org
2012-01-13 22:21 ` burnus at gcc dot gnu.org
2012-01-18 23:00 ` pault at gcc dot gnu.org
2012-01-19  8:49 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).