ICE with user type initialisation

Paul Thomas paulthomas2@wanadoo.fr
Tue Aug 22 20:08:00 GMT 2006


Martin,

This could be one of or both of my and Erik's doings; Erik did a face 
lift on intent out with default intializers at the same time I gave 
derived types a heart transplant. Please submit a PR.

Paul

> Hi,
>
> This code ICEs as given, but using the alternatives in comments works. 
> I'm no expert so this could be my mis-interpretation of how INTENT is 
> supposed to work, but I thought INTENT(OUT) would apply any default 
> initialisation to the dummy argument. I'm also fairly convinced that 
> this code worked between last Thursday and about the following Sunday.
>
> ---------------------------------------------------------
>
> MODULE bar
> !
> TYPE x
> INTEGER :: y = 0 ! fails
> ! INTEGER :: y ! works
> END TYPE x
> !
> END MODULE bar
> !
> MODULE ice_mod
> CONTAINS
> !
> SUBROUTINE ice (z)
> USE bar
> !
> TYPE (x) :: z(:)
> !
> CALL foo (z(1))
> RETURN
> !
> END SUBROUTINE ice
> !
> SUBROUTINE foo (z)
> USE bar
> !
> TYPE (x), INTENT(OUT) :: z ! fails
> ! TYPE (x), INTENT(INOUT) :: z ! works
> ! TYPE (x) :: z ! works
> !
> z % y = 1
> RETURN
> END SUBROUTINE foo
> !
> END MODULE ice_mod
>
> -------------------------------------------------------------
>
> ice.f95: In function 'ice':
> ice.f95:31: 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.
>
> GNU Fortran 95 (GCC) 4.2.0 20060820 (experimental)
> Copyright (C) 2006 Free Software Foundation, Inc.
>
> Linux 2.6.17-1.2157_FC5 x86_64
>
> --------------------------------------------------------------
>
> I couldn't find any existing PR, shall I submit one?
>
> Cheers,
> Martin
>
>



More information about the Fortran mailing list