[PATCH] Bail out in gfc_dep_compare_expr for a NULL argument.
Tobias Burnus
tobias@codesourcery.com
Tue Dec 10 14:00:00 GMT 2019
Hi Martin,
On 12/10/19 2:04 PM, Martin Liška wrote:
> The patch is about early bail out in gfc_dep_compare_expr function
> when one of the arguments (and not both at the same time) is null.
> I'm not sure, it's a proper fix however.
I think it is the best one can do. Technically, one could replace the
comparison by
"length == 1 || "" == x(1:)" but I am not sure whether that would be be
advantageous in general (esp. when taking implementation time into
account); in any case, that's independent of the ICE.
The caller in this example is "are_identical_variables":
if (gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0)
return false;
comparing the string end.
And "-2 if the relationship could not be determined".
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
Yes; it looks good to me â thanks!
Tobias
> gcc/fortran/ChangeLog:
>
> 2019-12-10 Martin Liska <mliska@suse.cz>
>
> Â Â Â Â PR fortran/92874
> Â Â Â Â * dependency.c (gfc_dep_compare_expr): Bail out
> Â Â Â Â when one of the arguments is null.
>
> gcc/testsuite/ChangeLog:
>
> 2019-12-10 Martin Liska <mliska@suse.cz>
>
> Â Â Â Â PR fortran/92874
> Â Â Â Â * gfortran.dg/pr92874.f90: New test.
> ---
>  gcc/fortran/dependency.c             | 2 ++
> Â gcc/testsuite/gfortran.dg/pr92874.f90 | 11 +++++++++++
> Â 2 files changed, 13 insertions(+)
> Â create mode 100644 gcc/testsuite/gfortran.dg/pr92874.f90
>
>
More information about the Fortran
mailing list