[Bug fortran/84006] [7/8/9 Regression] ICE in storage_size() with CLASS entity

2019-02-05 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006

--- Comment #5 from Thomas Koenig  ---
However, this also fails:

program p
  type t
integer i
  end type
  integer rslt
  class(t), allocatable :: t_alloc(:)
  allocate (t_alloc(10), source=t(1))
  rslt = storage_size(t_alloc)
end program p

$ cat a.f90
program p
  type t
integer i
  end type
  integer rslt
  class(t), allocatable :: t_alloc(:)
  allocate (t_alloc(10), source=t(1))
  rslt = storage_size(t_alloc)
end program p
$ gfortran a.f90
a.f90:8:0:

8 |   rslt = storage_size(t_alloc)
  | 
interner Compiler-Fehler: Speicherzugriffsfehler
0xe24dbf crash_signal
../../trunk/gcc/toplev.c:326
0x9582fe gfc_conv_intrinsic_storage_size
../../trunk/gcc/fortran/trans-intrinsic.c:7683
0x960de1 gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
../../trunk/gcc/fortran/trans-intrinsic.c:10013
0x939b6a gfc_conv_expr(gfc_se*, gfc_expr*)
../../trunk/gcc/fortran/trans-expr.c:8315
0x9437c2 gfc_trans_assignment_1
../../trunk/gcc/fortran/trans-expr.c:10524
0x8ffcf2 trans_code
../../trunk/gcc/fortran/trans.c:1822
0x92c2fb gfc_generate_function_code(gfc_namespace*)
../../trunk/gcc/fortran/trans-decl.c:6530
0x8b3eae translate_all_program_units
../../trunk/gcc/fortran/parse.c:6134
0x8b3eae gfc_parse_file()
../../trunk/gcc/fortran/parse.c:6337
0x8fd06f gfc_be_parse_file
../../trunk/gcc/fortran/f95-lang.c:204
Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;
inclusive vorverarbeitetem Quellcode, wenn es dienlich ist.
Please include the complete backtrace with any bug report.

[Bug fortran/84006] [7/8/9 Regression] ICE in storage_size() with CLASS entity

2019-02-05 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006

--- Comment #4 from Dominique d'Humieres  ---
> Looks valid to me.
>
> F2018, 16.9.184 STORAGE_SIZE (A [, KIND])
>
> 3 Arguments.
> A shall be a data object of any type. If it is polymorphic it shall not
> be an undefined pointer. If it is unlimited polymorphic or has
> any deferred type parameters, it shall not be an unallocated
> allocatable variable or a disassociated or undefined pointer.

AFAIU

  class(t), allocatable :: t_alloc(:)
  rslt = storage_size(t_alloc)

t_alloc is unallocated, hence the code is invalid.

[Bug fortran/84006] [7/8/9 Regression] ICE in storage_size() with CLASS entity

2019-02-05 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006

Thomas Koenig  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||tkoenig at gcc dot gnu.org

--- Comment #3 from Thomas Koenig  ---
Looks valid to me.

F2018, 16.9.184 STORAGE_SIZE (A [, KIND])

3 Arguments.
A shall be a data object of any type. If it is polymorphic it shall not be an
undefined pointer. If
it is unlimited polymorphic or has any deferred type parameters, it shall not
be an unallocated
allocatable variable or a disassociated or undefined pointer.

[Bug fortran/84006] [7/8/9 Regression] ICE in storage_size() with CLASS entity

2018-12-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.4 |7.5