This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR71068 - fix ICE on invalid with coindexed DATA
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Tue, 21 Jun 2016 19:46:43 +0200
- Subject: Re: [Patch, Fortran] PR71068 - fix ICE on invalid with coindexed DATA
- Authentication-results: sourceware.org; auth=none
- References: <20160621141553 dot GA9633 at physik dot fu-berlin dot de>
Dear Tobias,
"Beauty is in the eye of the beholder!" It works, it's good :-)
OK for trunk
Thanks for the patch
Paul
PS Why, in principle, can data objects not have co-indices?
On 21 June 2016 at 16:15, Tobias Burnus
<tobias.burnus@physik.fu-berlin.de> wrote:
> Dear all,
>
> the problem comes up with:
> data a(1)[1] /1/
> which is invalid. In resolve.c's check_data_variable(), one has:
>
> if (!gfc_resolve_expr (var->expr))
> return false;
> ...
> e = var->expr;
>
> if (e->expr_type != EXPR_VARIABLE)
> gfc_internal_error ("check_data_variable(): Bad expression");
>
> which triggers as resolve_variable() has:
>
> if (t && flag_coarray == GFC_FCOARRAY_LIB && gfc_is_coindexed (e))
> add_caf_get_intrinsic (e);
>
>
> The solution is either not to decorate the DATA variable with
> caf_get() - or to strip it off for testing. The latter has been
> done in this patch. It's not really beautify, but works.
>
> Additionally, I had to add the argument-handling short cut
> as otherwise, more and more caf_get() could be added around the
> argument, which is both pointless and causes the strip off to
> fail.
>
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk? Or do you see a more beautiful approach?
>
> Tobias
--
The difference between genius and stupidity is; genius has its limits.
Albert Einstein