public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Mikael Morin <morin-mikael@orange.fr>,
	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 21:24:54 +0100	[thread overview]
Message-ID: <eefbb13e-df54-fee2-b414-9f9c24011acb@gmx.de> (raw)
In-Reply-To: <d6f0d7a0-711d-60d8-ee3f-35b5136d9e83@orange.fr>

Am 16.11.22 um 12:39 schrieb Mikael Morin:
> 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.
>

Thanks, pushed.

I've opened a PR for the elusive loss of the typespec so that it
won't be forgotten:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107721

Really a weird thing...


      reply	other threads:[~2022-11-16 20:24 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
2022-11-16 20:24   ` Harald Anlauf [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=eefbb13e-df54-fee2-b414-9f9c24011acb@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=morin-mikael@orange.fr \
    /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).