Bug 60881 - ICE on dummy argument that extends a type with scalar and scalar coarry components
Summary: ICE on dummy argument that extends a type with scalar and scalar coarry compo...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-04-18 07:57 UTC by Damian Rouson
Modified: 2014-04-22 19:36 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.10.0, 4.7.4, 4.8.3, 4.9.0
Last reconfirmed: 2014-04-18 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damian Rouson 2014-04-18 07:57:32 UTC
The code and error message below demonstrate an ICE that occurs when passing an actual argument that extends a type with two components: a default-initialized scalar and an allocatable scalar coarray.

Damian


$ cat all.f90 
program main
  implicit none
  type co_object
    logical :: defined=.false.
    real, allocatable :: dummy_to_facilitate_extension[:]
  end type
  type, extends(co_object) :: global_field
  end type
  type(global_field) T
  call assign_local_field(T)
contains
  subroutine assign_local_field(lhs)
    type(global_field) lhs
  end subroutine
end program

$ gfortran -fcoarray=single all.f90 
all.f90: In function 'MAIN__':
all.f90:9:0: internal compiler error: in fold_convert_loc, at fold-const.c:2116
   type(global_field) T
 ^

all.f90:9:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort trap: 6

$ gfortran --version
GNU Fortran (MacPorts gcc49 4.9-20140406_0) 4.9.0 20140406 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
Comment 1 Dominique d'Humieres 2014-04-18 08:17:54 UTC
Confirmed on 4.7.4, 4.8.3, 4.9.0, and trunk.
Comment 2 Tobias Burnus 2014-04-22 19:29:15 UTC
Author: burnus
Date: Tue Apr 22 19:28:43 2014
New Revision: 209657

URL: http://gcc.gnu.org/viewcvs?rev=209657&root=gcc&view=rev
Log:
2014-04-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/60881
        * trans-expr.c (gfc_trans_subcomponent_assign): Fix handling
        of scalar coarrays.

2014-04-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/60881
        * coarray/alloc_comp_3.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/coarray/alloc_comp_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Tobias Burnus 2014-04-22 19:36:50 UTC
FIXED on the trunk (GCC 4.10).

Thanks for the report!