From: Tobias Burnus <tobias@codesourcery.com>
To: HAO CHEN GUI <guihaoc@linux.ibm.com>,
gcc-patches <gcc-patches@gcc.gnu.org>,
fortran <fortran@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
David <dje.gcc@gmail.com>, Kewen.Lin <linkw@linux.ibm.com>,
Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCHv4, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]
Date: Tue, 21 Mar 2023 11:09:16 +0100 [thread overview]
Message-ID: <22416d66-11d3-e836-f786-696269c5907c@codesourcery.com> (raw)
In-Reply-To: <fe6ba084-3b72-7ae9-1cb3-9a3ad889eaf8@linux.ibm.com>
Hi,
LGTM, except for:
On 21.03.23 07:29, HAO CHEN GUI wrote:
> @@ -4708,7 +4710,12 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
>
> finish:
> if (result == &gfc_bad_expr)
> - return false;
> + {
> + if (errorcount == old_errorcount
> + && (!gfc_buffered_p () && !gfc_error_flag_test ()))
> + gfc_error ("Cannot simplify expression at %L", &e->where);
> + return false;
> + }
The second line of the condition now tests:
* 'If buffering is disabled and no pending buffed error exists
then show an error'
But if should tests:
* 'If (buffering is disabled) OR ((it is enabled but) no buffered error exists)
then show¹ an error'
Thus, you should use an '||' not a '&&':
+ && (!gfc_buffered_p () || !gfc_error_flag_test ()))
as proposed in previous email. A quick regtesting shows no fails when doing so.
OK with that change.
(¹or rather: 'then buffer an error')
Thanks for the patch!
Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
prev parent reply other threads:[~2023-03-21 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 6:29 HAO CHEN GUI
2023-03-21 10:09 ` 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=22416d66-11d3-e836-f786-696269c5907c@codesourcery.com \
--to=tobias@codesourcery.com \
--cc=bergner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=guihaoc@linux.ibm.com \
--cc=linkw@linux.ibm.com \
--cc=segher@kernel.crashing.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).