public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: Harald Anlauf <anlauf@gmx.de>, fortran <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fortran: ICE in simplification of array expression involving power [PR107680]
Date: Wed, 16 Nov 2022 12:39:28 +0100	[thread overview]
Message-ID: <d6f0d7a0-711d-60d8-ee3f-35b5136d9e83@orange.fr> (raw)
In-Reply-To: <trinity-98e07e65-78c9-4364-866f-6b4d29f24992-1668545104036@3c-app-gmx-bs61>

Le 15/11/2022 à 21:45, Harald Anlauf via Fortran a écrit :
> Dear all,
> 
> when constant expressions involve parentheses, array constructors,
> typespecs, and the power operator (**), we could fail with an ICE
> during simplification in arith_power.
> 
> Debugging of the testcase showed we call the proper type conversions
> needed for the arithmetic operation, but under certain circumstances
> we seem to lose the typespec on the way to the invocation of the
> simplification.  We then run into unhandled combinations of operand
> types.
> 
> The attached patch is likely a sort of a band-aid to the problem:
> we check the operand types in arith_power, and if we see that a
> conversion is (still) needed, we punt and defer the simplification.
> 
> AFAICT this is safe.  It does not address a possibly deeply
> covered issue in gfortran, which was suspected when analyzing
> pr107000.  But as this is elusive, that may be hard to locate
> and fix.
> 
> Regtested on x86_64-pc-linux-gnu.  OK for mainline?
> 
Yes, let's go with this.
Thanks for investigating.

  reply	other threads:[~2022-11-16 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 20:45 Harald Anlauf
2022-11-16 11:39 ` Mikael Morin [this message]
2022-11-16 20:24   ` Harald Anlauf

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=d6f0d7a0-711d-60d8-ee3f-35b5136d9e83@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=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).