This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

ICE due to an elemental function returning a derived type


Dear all,

The attached code fails to compile with GNU Fortran 95 (GCC) 4.2.0 20060804 (experimental). The following error messages are produced:

[aardschokker:~] mark% gfortran -c -Wall derived_type_1.f90
derived_type_1.f90: In function 'bar':
derived_type_1.f90:13: warning: unused variable 'x'
derived_type_1.f90:13: internal compiler error: in fold_convert, at fold-const.c:2098
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


Could any of the GNU Fortran maintainers please have a look at this problem?

Kind regards,

Mark

---

MODULE types
   TYPE, PUBLIC   :: ieee_class_type
      INTEGER     :: ieee_particular_features
   END TYPE
END MODULE types

MODULE foo
   USE types
   PUBLIC                                    :: ieee_class_type
   TYPE(ieee_class_type), PARAMETER, PUBLIC  :: &
      IEEE_SIGNALING_NAN=ieee_class_type(0)
CONTAINS
   ELEMENTAL FUNCTION bar (x) RESULT(class)
      USE types
      REAL, INTENT(IN)        :: x
      TYPE(ieee_class_type)   :: class
      class=IEEE_SIGNALING_NAN
   END FUNCTION bar
END MODULE

LOGICAL ELEMENTAL FUNCTION foobar (x)
   USE foo
   REAL, INTENT(IN)        :: x
   TYPE(ieee_type_class)   :: class

   foobar=.FALSE.
   class=bar (x)
   IF (class==IEEE_SIGNALING_NAN) foobar=.TRUE.

END FUNCTION foobar


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