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] PR fortran/103777 - ICE in gfc_simplify_maskl, at fortran/simplify.c:4918
Date: Thu, 6 Jan 2022 20:50:33 +0100	[thread overview]
Message-ID: <978d4418-780e-dae1-a51c-62af41be301b@gmx.de> (raw)
In-Reply-To: <6610f3ca-3aa1-834d-ac20-c7a667b11bc8@orange.fr>

Hi Mikael,

Am 21.12.21 um 13:38 schrieb Mikael Morin:
> Le 20/12/2021 à 23:05, Harald Anlauf via Fortran a écrit :
>> Dear all,
>>
>> we need to check the arguments of the elemental MASKL and MASKR
>> intrinsics also before simplifying.
>>
>> Testcase by Gerhard.  The fix is almost obvious, but I'm happy to
>> get feedback in case there is something I overlooked.  (There is
>> already a check on scalar arguments to MASKL/MASKR, which however
>> misses the case of array arguments.)
>>
>> Regtested on x86_64-pc-linux-gnu.  OK for mainline?
>>
> Your patch looks reasonable and safe.
> However, I find it surprising that it’s actually needed, as gfc_check
> mask is already the check function associated to maskl and maskr in the
> definition of the symbols.  The simplification function should be called
> only when the associated check function has returned successfully, so it
> shouldn’t be necessary to call it again at simplification time.
> Looking at the backtrace, it is the do_simplify call at the beginning of
>   gfc_intrinsic_func_interface that seems dubious to me, as it comes
> before all the check further down in the function and it looks redundant
> with the other simplification code after the checks.
>
> So I’m inclined to test whether by any chance removing that call works,
> and if it doesn’t, let’s go with this patch.

Did you find the time to try your version?

> Mikael
>

Thanks,
Harald

WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR fortran/103777 - ICE in gfc_simplify_maskl, at fortran/simplify.c:4918
Date: Thu, 6 Jan 2022 20:50:33 +0100	[thread overview]
Message-ID: <978d4418-780e-dae1-a51c-62af41be301b@gmx.de> (raw)
Message-ID: <20220106195033.C-0iY-qTLf_LjW3Y8J6AZSWeHU5yStaYVXGNZtXXHa4@z> (raw)
In-Reply-To: <6610f3ca-3aa1-834d-ac20-c7a667b11bc8@orange.fr>

Hi Mikael,

Am 21.12.21 um 13:38 schrieb Mikael Morin:
> Le 20/12/2021 à 23:05, Harald Anlauf via Fortran a écrit :
>> Dear all,
>>
>> we need to check the arguments of the elemental MASKL and MASKR
>> intrinsics also before simplifying.
>>
>> Testcase by Gerhard.  The fix is almost obvious, but I'm happy to
>> get feedback in case there is something I overlooked.  (There is
>> already a check on scalar arguments to MASKL/MASKR, which however
>> misses the case of array arguments.)
>>
>> Regtested on x86_64-pc-linux-gnu.  OK for mainline?
>>
> Your patch looks reasonable and safe.
> However, I find it surprising that it’s actually needed, as gfc_check 
> mask is already the check function associated to maskl and maskr in the 
> definition of the symbols.  The simplification function should be called 
> only when the associated check function has returned successfully, so it 
> shouldn’t be necessary to call it again at simplification time.
> Looking at the backtrace, it is the do_simplify call at the beginning of 
>   gfc_intrinsic_func_interface that seems dubious to me, as it comes 
> before all the check further down in the function and it looks redundant 
> with the other simplification code after the checks.
> 
> So I’m inclined to test whether by any chance removing that call works, 
> and if it doesn’t, let’s go with this patch.

Did you find the time to try your version?

> Mikael
> 

Thanks,
Harald


  reply	other threads:[~2022-01-06 19:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 22:05 Harald Anlauf
2021-12-21 12:38 ` Mikael Morin
2022-01-06 19:50   ` Harald Anlauf [this message]
2022-01-06 19:50     ` Harald Anlauf
2022-01-06 21:44     ` Mikael Morin
2022-01-09 20:12       ` Mikael Morin
2022-01-09 21:25         ` 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=978d4418-780e-dae1-a51c-62af41be301b@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).