public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>,
	Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: Re: [Patch, Fortran] PR71068 - fix ICE on invalid with coindexed DATA
Date: Tue, 21 Jun 2016 18:21:00 -0000	[thread overview]
Message-ID: <576985A2.4010905@net-b.de> (raw)
In-Reply-To: <CAGkQGiLWokP18fFwLz=f-_sGjXo=WqxFC8buDhu8ubrT943D1A@mail.gmail.com>

Dear Paul,

Paul Richard Thomas wrote:
> Thanks for the patch
Thanks also from my side.

> PS Why, in principle, can data objects not have co-indices?

I think there is no really fundamental reason, but it doesn't make 
really sense. DATA is an explicit initialization, similar to
   "integer :: i = 5"
and (mostly) has implicitly the SAVE attribute. [5.6.7 @ J3/16-007r1] To 
initialize the variable on a remote image feels odd - especially as each 
image initializes it to the same value.

[Side remark, since I just stumbled over it: "The statement ordering 
rules allow DATA statements to appear anywhere in a program unit after 
the specification statements. The ability to position DATA statements 
amongst executable statements is very rarely used, unnecessary, and a 
potential source of error." (B.3.5 in the section of obsolescent 
features in F2015 (J3/16-007r1).)]

Cheers,

Tobias

>
> 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
>
>

      reply	other threads:[~2016-06-21 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 14:16 Tobias Burnus
2016-06-21 17:46 ` Paul Richard Thomas
2016-06-21 18:21   ` Tobias Burnus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576985A2.4010905@net-b.de \
    --to=burnus@net-b.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.com \
    --cc=tobias.burnus@physik.fu-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).