User account creation filtered due to spam.

Bug 51293 - [OOP] ICE on ANY with overloaded == operator
Summary: [OOP] ICE on ANY with overloaded == operator
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2011-11-24 11:11 UTC by Jakub Jelinek
Modified: 2016-11-16 14:25 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2011-11-24 11:11:57 UTC
module stuff
   implicit none
   type a
      integer :: i, j
   end type a
   interface operator (==)
      module procedure equal_a
   end interface operator (==)
   elemental function equal_a (x,y) result (same)
      class (a), intent(in) :: x, y
      logical :: same
      if ( x%i == y%i .and. x%j == y%j ) then
         same = .TRUE.
         same = .FALSE.
      end if
   end function equal_a
end module stuff
program bugtest
   use stuff
   type (a), dimension(10) :: h
   type (a) :: g
   integer :: i
   if ( any(h == g) ) then
      write (*,*)
   end if
end program bugtest

ICEs on the trunk as well as 4.6 branch.
Comment 1 Tobias Burnus 2011-11-24 14:13:39 UTC
This usage requires support for polymorphic arrays - or at least the scalarizer needs to be able to handle this, which is part of the work Paul did.

Latest publicly available version of Paul's patch:

At least with the version I have, it works. The patch will be submitted in soon; there are still some small issues which should be fixed before it is submitted.
Comment 2 Tobias Burnus 2011-12-12 09:22:18 UTC
FIXED on the 4.7 trunk by the patch for PR 41539  (Rev. 182210).