GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.

Bug 51075

Summary: ICE with deferred-length character pointer component in derived types
Product: gcc Reporter: Tobias Burnus <burnus>
Component: fortranAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: burnus
Priority: P3 Keywords: ice-on-valid-code
Version: 4.7.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Bug Depends on: 45170    
Bug Blocks:    
Attachments: ICE with allocatable type component

Description Tobias Burnus 2011-11-10 10:22:26 UTC
The following program gives an ICE, which is maybe not surprising as deferred-length components are not yet supported.

internal compiler error: in gfc_get_derived_type, at fortran/trans-types.c:2394

Expected:
- Short term: Reject it ("sorry not yet implemented")
- Long term: Support it.


 character(len=42), target, save :: A
 type :: t
   character(len=:), pointer :: P => A
 end type t
 type(T) :: X
end
Comment 1 koen.poppe 2011-11-23 14:32:59 UTC
Created attachment 25902 [details]
ICE with allocatable type component

>> gfortran -c -std=f2008 -Wall -Wextra ehe.f03
ehe.f03: In function ‘ehe’:
ehe.f03:18:0: internal compiler error: in gfc_get_derived_type, at fortran/trans-types.c:2394
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [ehe.o] Error 1
Comment 2 Tobias Burnus 2011-12-15 15:18:40 UTC
Author: burnus
Date: Thu Dec 15 15:18:33 2011
New Revision: 182372

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182372
Log:
2011-12-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51550
        PR fortran/47545
        PR fortran/49050
        PR fortran/51075
        * resolve.c (resolve_fl_derived0): Print not-implemented error
        for deferred-length character components.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
Comment 3 Tobias Burnus 2011-12-15 15:25:39 UTC
Author: burnus
Date: Thu Dec 15 15:25:32 2011
New Revision: 182373

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182373
Log:
2011-12-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51550
        PR fortran/47545
        PR fortran/49050
        PR fortran/51075
        * resolve.c (resolve_fl_derived0): Print not-implemented error
        for deferred-length character components.


Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/resolve.c
Comment 4 Tobias Burnus 2012-01-24 08:04:21 UTC
The ICE is fixed - but deferred-length character components are not supported: Instead of an internal compiler error, one now gets a "not yet implemented" error.

Its implementation of is now tracked at PR 51976.

*** This bug has been marked as a duplicate of bug 51976 ***