Bug 69419 - ICE: tree check: expected array_type, have real_type in gfc_conv_array_initializer, at fortran/trans-array.c:5618
Summary: ICE: tree check: expected array_type, have real_type in gfc_conv_array_initia...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: anlauf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-21 19:37 UTC by Gerhard Steinmetz
Modified: 2021-11-05 22:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-01-22 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Steinmetz 2016-01-21 19:37:07 UTC
$ cat z1.f90
blockdata
   real x
   common /c/ x[*]
   data x /1.0/
end blockdata


$ gfortran-6 --version
GNU Fortran (SUSE Linux) 6.0.0 20160108 (experimental) [trunk revision 232162]


$ gfortran-6 -fcoarray=single -c z1.f90
z1.f90:5:0:

 end blockdata

internal compiler error: tree check: expected array_type, have real_type in gfc_conv_array_initializer, at fortran/trans-array.c:5618
Comment 1 Gerhard Steinmetz 2016-01-21 19:37:25 UTC
$ gfortran-5.3.1 -fcoarray=single -c z1.f90
z1.f90:5:0:

 end blockdata
 ^
internal compiler error: Segmentation fault
Comment 2 Dominique d'Humieres 2016-01-22 10:19:24 UTC
Confirmed: from 4.8 up to 5.3 the ICE is a Segmentation fault and the ICE is in gfc_conv_array_initializer, at fortran/trans-array.c for trunk (6.0).
Comment 4 GCC Commits 2021-11-05 22:15:38 UTC
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:432ed97b992ccfe93616d5af1fa5c1a7d7aff9ff

commit r12-4964-g432ed97b992ccfe93616d5af1fa5c1a7d7aff9ff
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Nov 5 23:13:57 2021 +0100

    Fortran: a symbol in a COMMON cannot be a coarray
    
    gcc/fortran/ChangeLog:
    
            PR fortran/69419
            * match.c (gfc_match_common): Check array spec of a symbol in a
            COMMON object list and reject it if it is a coarray.
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/69419
            * gfortran.dg/pr69419.f90: New test.
Comment 5 anlauf 2021-11-05 22:18:09 UTC
Fixed on mainline for gcc-12.  Closing.

Thanks for the report!