https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52332
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Compiling the code attached to comment 0 with recent versions of gfortran gives now the following error elemental subroutine xml_attribute( attr, name, value ) 1 Error: INTENT(OUT) argument 'attr' of pure procedure 'xml_attribute' at (1) may not be polymorphic The ICE is restored with the following changes --- pr52332.f90 2013-06-10 19:04:33.000000000 +0200 +++ pr52332_db.f90 2015-09-09 11:44:25.000000000 +0200 @@ -1,3 +1,4 @@ +! { dg-do compile } module m_string !------------------------------------------------------------------------------- @@ -1982,7 +1983,7 @@ end subroutine write_end_tag ! Initialise an attribute from name and value (character version) -elemental subroutine xml_attribute( attr, name, value ) +impure elemental subroutine xml_attribute( attr, name, value ) ! The XML attribute structure class(t_xml_attribute), intent(out) :: attr @@ -2194,7 +2195,7 @@ module m_xfunit_assertion contains ! Virtual constructor -pure subroutine xfunit_assertion( ast, name, type, status ) +subroutine xfunit_assertion( ast, name, type, status ) ! The assertion class(t_xfunit_assertion), intent(out) :: ast @@ -2350,7 +2351,7 @@ module m_xfunit_assertion_character contains ! Constructor for character assertion -elemental subroutine xfunit_assertion_character( ast, name, actual, expected ) +impure elemental subroutine xfunit_assertion_character( ast, name, actual, expected ) ! The returned assertion class(t_xfunit_assertion_character), intent(out) :: ast @@ -2514,7 +2515,7 @@ module m_xfunit_assertion_array_characte contains ! Constructor for character array assertion -pure subroutine xfunit_assertion_array_character( ast, name, actual, expected ) +subroutine xfunit_assertion_array_character( ast, name, actual, expected ) ! The returned assertion class(t_xfunit_assertion_array_character), intent(out) :: ast and is fixed by the patch at https://gcc.gnu.org/ml/fortran/2015-09/msg00042.html.