public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fortran: error recovery on invalid array reference of non-array [PR103590]
Date: Tue, 19 Jul 2022 23:34:07 +0200	[thread overview]
Message-ID: <091e5ede-b816-0ba8-470c-7c648f9b2868@gmx.de> (raw)
In-Reply-To: <bd1e25ed-c977-b5c9-fbeb-a37c1317e56f@orange.fr>

Hi Mikael,

Am 19.07.22 um 22:53 schrieb Mikael Morin:
> It could be anything better than the (unhelpfull) internal error it is 
> replacing.
> I suggest for example "Invalid array reference of a non-array entity at 
> %L".

yes, that's much better!  The attached updated patch uses this.

Committed: r13-1757-gf838d15641d256e21ffc126c3277b290ed743928


>> gfortran's behavior during error handling is difficult to understand.
>> While the proposed new error message is emitted for associate_54.f90,
>> it never makes it far enough for the testcase of the present PR
>> (associate_59.f90).
>>
> Indeed.  We try to match several types of statement one after the other, 
> and each failed match can possibly register an error.  But it is emitted 
> only if all have failed (see gfc_error_check).  There is no choice of 
> the best error; the last one registered wins.
> 
> This buffering behavior is controlled by calls to gfc_buffer_error(...). 
>   Error handling during resolution doesn’t need to delay error reporting 
> as far as I know, and the calls to gfc_buffer_error (false) seem to 
> correctly disable buffering at the end of every call to next_statement. 
>   I don’t know why it remains active in this case.
> 

Alright, I should try to remember this and take a closer look next time
I get confused about not getting the error message I wanted...

Thanks,
Harald


WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: Mikael Morin <morin-mikael@orange.fr>, fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fortran: error recovery on invalid array reference of non-array [PR103590]
Date: Tue, 19 Jul 2022 23:34:07 +0200	[thread overview]
Message-ID: <091e5ede-b816-0ba8-470c-7c648f9b2868@gmx.de> (raw)
Message-ID: <20220719213407.phcxo_QFN7rkMxBF_NYxdj5aRJrVw80C7JW1QX9Iw7s@z> (raw)
In-Reply-To: <bd1e25ed-c977-b5c9-fbeb-a37c1317e56f@orange.fr>

Hi Mikael,

Am 19.07.22 um 22:53 schrieb Mikael Morin:
> It could be anything better than the (unhelpfull) internal error it is
> replacing.
> I suggest for example "Invalid array reference of a non-array entity at
> %L".

yes, that's much better!  The attached updated patch uses this.

Committed: r13-1757-gf838d15641d256e21ffc126c3277b290ed743928


>> gfortran's behavior during error handling is difficult to understand.
>> While the proposed new error message is emitted for associate_54.f90,
>> it never makes it far enough for the testcase of the present PR
>> (associate_59.f90).
>>
> Indeed.  We try to match several types of statement one after the other,
> and each failed match can possibly register an error.  But it is emitted
> only if all have failed (see gfc_error_check).  There is no choice of
> the best error; the last one registered wins.
>
> This buffering behavior is controlled by calls to gfc_buffer_error(...).
>   Error handling during resolution doesn’t need to delay error reporting
> as far as I know, and the calls to gfc_buffer_error (false) seem to
> correctly disable buffering at the end of every call to next_statement.
>   I don’t know why it remains active in this case.
>

Alright, I should try to remember this and take a closer look next time
I get confused about not getting the error message I wanted...

Thanks,
Harald

  reply	other threads:[~2022-07-19 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 20:43 Harald Anlauf
2022-07-19  9:03 ` Mikael Morin
2022-07-19 19:09   ` Harald Anlauf
2022-07-19 19:09     ` Harald Anlauf
2022-07-19 20:53     ` Mikael Morin
2022-07-19 21:34       ` Harald Anlauf [this message]
2022-07-19 21:34         ` Harald Anlauf
2022-07-20  9:40         ` Mikael Morin

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=091e5ede-b816-0ba8-470c-7c648f9b2868@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@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).