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

[Bug fortran/71196] f951: internal compiler error: in gfc_conv_string_init, at fortran/trans-const.c:149


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71196

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-05-19
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to georg.bugzilla from comment #0)

> module ice
> 
> type substructure_
>    integer :: id
>    character(16) :: value
> end type substructure_
> 
> type structure_
>    type(substructure_) :: element
> end type structure_
> 
> type(structure_) :: structure
> 
> DATA structure%element%id / 1 /
> DATA structure%element%value / "test" /
> 
> end module ice

As a workaround you can invert the order of components
in substructure_, so try

type substructure_
   character(16) :: value
   integer :: id
end type substructure_

Another workaround would be to use a structure constructor
in the DATA statement.  With you original example, you can
do

DATA structure%element / substructure_(1,"test") /

Yet, another workaround would be use of explicit initialization
in the declaration, but it's a little ugly

type(structure_) :: structure = structure_(substructure_(1,"test"))

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