[Patch, committed][Fortran] avoid ICE in gfc_omp_check_optional_argument (PR93464)

Tobias Burnus tobias@codesourcery.com
Tue Jan 28 11:30:00 GMT 2020


(This was a GCC 10 regression, affecting both OpenMP and OpenACC.)

In gfc_omp_check_optional_argument:

DECL_LANG_SPECIFIC is always available (check at the top). However, if 
decl is not a PARM_DECL, it can have two reasons: Either it is no 
parameter (C sense; Fortran: dummy argument) at all or – as gfortran 
does for assumed-shape arrays – it is a locally defined decl which 
belongs to the array parameter. In the latter case, 
GFC_DECL_SAVED_DESCRIPTOR contains the actual PARAM_DECL.

Well, as this test case shows, the GFC_DESCRIPTOR_TYPE_P condition is 
fulfilled, but as it is a locally defined variable, 
GFC_DECL_SAVED_DESCRIPTOR is NULL.

The reason that it didn't show up before is that most of the local 
arrays do not have DECL_LANG_SPECIFIC – this one does because it is a 
character string (used for the string length).

Applied as obvious after building and regtesting.

Cheers,

Tobias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: committed.diff
Type: text/x-patch
Size: 3420 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200128/396344bf/attachment.bin>


More information about the Gcc-patches mailing list