public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janus Weil <janus@gcc.gnu.org>
To: "Dominique d'Humières" <dominiq@lps.ens.fr>
Cc: gfortran <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
		Jerry DeLisle <jvdelisle@gcc.gnu.org>
Subject: Re: [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
Date: Sat, 03 Dec 2016 07:05:00 -0000	[thread overview]
Message-ID: <CAKwh3qg71UyshsWQaDVViXKxUx5R=7YKXx5=wFT3YeXDKcfY-Q@mail.gmail.com> (raw)
In-Reply-To: <CAKwh3qhRn7HZU2SP17woe5hDxsvabcCmusFH3T+5Q8gW0=wx4A@mail.gmail.com>

double-ping!


2016-11-26 10:45 GMT+01:00 Janus Weil <janus@gcc.gnu.org>:
> ping!
>
>
> 2016-11-19 10:12 GMT+01:00 Janus Weil <janus@gcc.gnu.org>:
>> Hi all,
>>
>>> I previously assumed that the test case for this PR would be legal,
>>> but by now I think that's wrong. The test case should be rejected, and
>>> we already have checking mechanisms for this (see
>>> resolve_fl_variable), but apparently they are not working.
>>>
>>> My current suspicion is that 'gfc_is_constant_expr' has a bug, because
>>> it claims the call to the function 'get_i' to be a constant
>>> expression. This is not true, because get_i() can not be reduced to a
>>> compile-time constant.
>>
>> some more reading in the standard confirms this suspicion: In
>> gfc_is_constant_expr there is a piece of code which claims that
>> specification functions are constant. That is certainly not true, and
>> so what I'm doing in the attached fix is to remove that code and add
>> some references to the standard to make things clearer.
>>
>> The code that I'm removing has last been touched in this commit by
>> Jerry six years ago:
>>
>> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=166520
>>
>> However, this did not introduce the bug in the first place (not sure
>> when that happened).
>>
>> In any case the new patch in the attachment regtests cleanly and
>> correctly rejects the original test case as well as one of the cases
>> mentioned by Dominique. Ok for trunk?
>>
>> Cheers,
>> Janus
>>
>>
>>
>> 2016-11-19  Janus Weil  <janus@gcc.gnu.org>
>>
>>     PR fortran/78392
>>     * expr.c (gfc_is_constant_expr): Specification functions are not
>>     compile-time constants. Update documentation (add reference to F08
>>     standard), add a FIXME.
>>     (external_spec_function): Add reference to F08 standard.
>>     * resolve.c (resolve_fl_variable): Ditto.
>>
>> 2016-11-19  Janus Weil  <janus@gcc.gnu.org>
>>
>>     PR fortran/78392
>>     * gfortran.dg/constant_shape.f90: New test case.

  parent reply	other threads:[~2016-12-03  7:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 14:05 Dominique d'Humières
2016-11-18 21:06 ` Janus Weil
2016-11-19  9:12   ` Janus Weil
2016-11-26  9:45     ` Janus Weil
2016-11-26 16:37       ` Dominique d'Humières
2016-11-26 18:10         ` Janus Weil
2016-12-03  7:05       ` Janus Weil [this message]
2016-12-12 15:52         ` Janus Weil
2016-12-12 17:37           ` Paul Richard Thomas
2016-12-12 18:56             ` Janus Weil
  -- strict thread matches above, loose matches on Subject: below --
2016-11-18 13:03 Janus Weil

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='CAKwh3qg71UyshsWQaDVViXKxUx5R=7YKXx5=wFT3YeXDKcfY-Q@mail.gmail.com' \
    --to=janus@gcc.gnu.org \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle@gcc.gnu.org \
    /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).