[9/10 Regression, PATCH] fortran: ICE in gfc_validate_kind(): Got bad kind [PR93580]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[9/10 Regression, PATCH] fortran: ICE in gfc_validate_kind(): Got bad kind [PR93580]

Mark Eggleston
Please find attached a patch, it is based on Steve Kargl's patch in
PR93580 adding  a check for %len and test case.

The commit message in the patch includes change logs as I believe that
is the intended way forward. One thing I'm unsure of it how handle
multiple authors, it was easy in the ChangeLog files but it is not
obvious for git commit messages.

OK for master and gcc 9 branch?

gcc/fortran/ChangeLog:

     Steven G. Kargl  <[hidden email]>
     Mark Eggleston  <[hidden email]>

     PR fortran/93580
     * primary.c (gfc_match_varspec): If the symbol following %
     is re or im and the primary expression type is not BT_COMPLEX
     issue an error. If the symbol is len and the primary
     expression type is not BT_CHARACTER is an error.

gcc/testsuite/ChangeLog:

     Mark Eggleston <[hidden email]>

     PR fortran/93580
     * gfortran.dg/dg/pr93580.f90: New test.

--
https://www.codethink.co.uk/privacy.html


0001-fortran-ICE-using-undeclared-symbol-in-array-constru.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [9/10 Regression, PATCH] fortran: ICE in gfc_validate_kind(): Got bad kind [PR93580]

Steve Kargl
On Tue, Feb 11, 2020 at 02:41:26PM +0000, Mark Eggleston wrote:
> Please find attached a patch, it is based on Steve Kargl's patch in PR93580
> adding  a check for %len and test case.
>

Looks like the wrong diff was attached.

>  gcc/fortran/match.c                     | 4 ++--
>  gcc/testsuite/gfortran.dg/pr93484_1.f90 | 8 ++++++++
>  gcc/testsuite/gfortran.dg/pr93484_2.f90 | 8 ++++++++
>  3 files changed, 18 insertions(+), 2 deletions(-)
>  create mode 100644 gcc/testsuite/gfortran.dg/pr93484_1.f90
>  create mode 100644 gcc/testsuite/gfortran.dg/pr93484_2.f90
>
> diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
> index a74cb8c5c19..03adfca9bd9 100644
> --- a/gcc/fortran/match.c
> +++ b/gcc/fortran/match.c
> @@ -2222,9 +2222,9 @@ gfc_match_type_spec (gfc_typespec *ts)
>  
>  found:
>  
> -      m = gfc_match_init_expr (&e);
> +      m = gfc_match_expr (&e);
>        if (m == MATCH_NO || m == MATCH_ERROR)
> - return MATCH_NO;
> + return m;

--
steve
Reply | Threaded
Open this post in threaded view
|

Re: [9/10 Regression, PATCH] fortran: ICE in gfc_validate_kind(): Got bad kind [PR93580]

Mark Eggleston
So it does, I'll have an other go.


On 11/02/2020 15:20, Steve Kargl wrote:

> On Tue, Feb 11, 2020 at 02:41:26PM +0000, Mark Eggleston wrote:
>> Please find attached a patch, it is based on Steve Kargl's patch in PR93580
>> adding  a check for %len and test case.
>>
> Looks like the wrong diff was attached.
>
>>   gcc/fortran/match.c                     | 4 ++--
>>   gcc/testsuite/gfortran.dg/pr93484_1.f90 | 8 ++++++++
>>   gcc/testsuite/gfortran.dg/pr93484_2.f90 | 8 ++++++++
>>   3 files changed, 18 insertions(+), 2 deletions(-)
>>   create mode 100644 gcc/testsuite/gfortran.dg/pr93484_1.f90
>>   create mode 100644 gcc/testsuite/gfortran.dg/pr93484_2.f90
>>
>> diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
>> index a74cb8c5c19..03adfca9bd9 100644
>> --- a/gcc/fortran/match.c
>> +++ b/gcc/fortran/match.c
>> @@ -2222,9 +2222,9 @@ gfc_match_type_spec (gfc_typespec *ts)
>>  
>>   found:
>>  
>> -      m = gfc_match_init_expr (&e);
>> +      m = gfc_match_expr (&e);
>>         if (m == MATCH_NO || m == MATCH_ERROR)
>> - return MATCH_NO;
>> + return m;

--
https://www.codethink.co.uk/privacy.html

Reply | Threaded
Open this post in threaded view
|

Re: [9/10 Regression, PATCH] fortran: ICE in gfc_validate_kind(): Got bad kind [PR93580]

Thomas Koenig-6
In reply to this post by Mark Eggleston
Hi Mark,

> OK for master and gcc 9 branch?

Looks good.

Thanks!

Regards

        Thomas