http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57959

            Bug ID: 57959
           Summary: ICE with structure constructor with scalar allocatable
                    components
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

Based on the array example in PR57957, which compiles. The following:

  type :: type1
    real, allocatable :: anum
  end type type1

  ... = type1(5.0)

fails with:
0x7b3b5d fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:1952
0x5fb036 gfc_trans_scalar_assign(gfc_se*, gfc_se*, gfc_typespec, bool, bool,
bool)
        ../../gcc/fortran/trans-expr.c:6899


Full example:

program main
  implicit none
  type :: type1
    real, allocatable :: anum
  end type type1

  type :: type2
    type(type1) :: temp
  end type type2
block
  type(type1) :: uKnot
  type(type2) :: a

  uKnot = type1(5.0)
  a = type2(uKnot)
end block
end

Reply via email to