Bug 56496 - [OOP] [F08] ICE with TYPE(*) coarray and SELECT TYPE
Summary: [OOP] [F08] ICE with TYPE(*) coarray and SELECT TYPE
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2013-03-01 15:01 UTC by Tobias Burnus
Modified: 2017-11-06 17:43 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-03-18 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2013-03-01 15:01:28 UTC
The following program gives an ICE:

$ gfortran -fcoarray=single test.f90
test.f90: In Funktion »MAIN__«:
test.f90:5:0: interner Compiler-Fehler: Speicherzugriffsfehler
   a= 5
 ^
0x99dc9f crash_signal
        ../../gcc/toplev.c:332
0x5fde88 tree_class_check
        ../../gcc/tree.h:3801
0x5fde88 gfc_conv_array_data(tree_node*)
        ../../gcc/fortran/trans-array.c:2662



class(*), allocatable :: A[:]
allocate(integer :: a[*])
select type(a)
type is (integer)
  a= 5
  print *, a
end select
end
Comment 1 Paul Thomas 2013-03-18 08:30:17 UTC
I was aware of this.  Is there not already a PR that covers it?

Cheers

Paul
Comment 2 G. Steinmetz 2017-11-06 17:42:37 UTC
Update :


$ gfortran-8-20171105 -c pr56496.f90 -fcoarray=single
pr56496.f90:5:0:

   a= 5

internal compiler error: Segmentation fault
0xb60fdf crash_signal
        ../../gcc/toplev.c:324
0x737444 gfc_conv_array_data(tree_node*)
        ../../gcc/fortran/trans-array.c:2936
0x73797d gfc_conv_ss_descriptor
        ../../gcc/fortran/trans-array.c:2874
0x73a167 gfc_conv_ss_startstride(gfc_loopinfo*)
        ../../gcc/fortran/trans-array.c:4227
0x76af6b gfc_trans_assignment_1
        ../../gcc/fortran/trans-expr.c:9954
0x7301b7 trans_code
        ../../gcc/fortran/trans.c:1828
0x79b208 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1877
0x72ffd7 trans_code
        ../../gcc/fortran/trans.c:1924
0x79d4a7 gfc_trans_select_type_cases
        ../../gcc/fortran/trans-stmt.c:2475
0x79d4a7 gfc_trans_select_type(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:3185
0x72ff47 trans_code
        ../../gcc/fortran/trans.c:1944
0x79b208 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1877
0x72ffd7 trans_code
        ../../gcc/fortran/trans.c:1924
0x756bfc gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6421
0x6e8b90 translate_all_program_units
        ../../gcc/fortran/parse.c:6091
0x6e8b90 gfc_parse_file()
        ../../gcc/fortran/parse.c:6294
0x72d3bf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204
Comment 3 G. Steinmetz 2017-11-06 17:43:32 UTC
Further reduced :


$ cat z1.f90
program p
   class(*), allocatable :: a[:]
   allocate (integer :: a[*])
   select type (a)
   type is (integer)
   end select
end


$ gfortran-8-20171105 -c z1.f90 -fcoarray=single
z1.f90:1:0:

 program p

internal compiler error: in gfc_conv_array_ref, at fortran/trans-array.c:3512
0x739662 gfc_conv_array_ref(gfc_se*, gfc_array_ref*, gfc_expr*, locus*)
        ../../gcc/fortran/trans-array.c:3512
0x7667cd gfc_conv_variable
        ../../gcc/fortran/trans-expr.c:2680
0x79b575 trans_associate_var
        ../../gcc/fortran/trans-stmt.c:1769
0x79b575 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1884
0x72ffd7 trans_code
        ../../gcc/fortran/trans.c:1924
0x79d4a7 gfc_trans_select_type_cases
        ../../gcc/fortran/trans-stmt.c:2475
0x79d4a7 gfc_trans_select_type(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:3185
0x72ff47 trans_code
        ../../gcc/fortran/trans.c:1944
0x79b208 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1877
0x72ffd7 trans_code
        ../../gcc/fortran/trans.c:1924
0x756bfc gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6421
0x6e8b90 translate_all_program_units
        ../../gcc/fortran/parse.c:6091
0x6e8b90 gfc_parse_file()
        ../../gcc/fortran/parse.c:6294
0x72d3bf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204