public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Ping! [Patch, fortran] PR87477 - [meta-bug] [F03] issues concerning the ASSOCIATE statement
Date: Fri, 7 Apr 2023 21:28:57 +0200	[thread overview]
Message-ID: <1b87744e-5e9a-f932-21e8-64d122f74a5c@gmx.de> (raw)
In-Reply-To: <CAGkQGiKT0-ppcJQuK3Mh1SLFNQDwGrsaH+BUKRvUiHsgqxGN=w@mail.gmail.com>

Hi Paul,

On 4/7/23 15:53, Paul Richard Thomas via Gcc-patches wrote:
> duuuh! Please find them attached.

the patch LGTM.  Thanks!

However, I have comments on the new testcase associate_60.f90:
subroutine pr93813 is missing an allocation of x, e.g.:

     allocate (t :: x)

otherwise it would be invalid.  Please check and fix.

Interestingly, subroutine pr92779 exhibits a small memory leak
with memory allocated by the spread intrinsic.  I played a little
and found that the leak depends on the presence of trim(): omitting
trim() removes the leak.  But looking at the related pr, it seems
that trim() was essential, so omitting it is likely not an option.

I think the best way is to proceed and to open a PR on the memory
leak rather than leaving pr92779 open.  What do you think?

Cheers,
Harald


> Thanks
>
> Paul
>
>
> On Fri, 7 Apr 2023 at 10:41, Harald Anlauf <anlauf@gmx.de> wrote:
>
>> Hi Paul,
>>
>> I don't see the new testcases.  Is this an issue on my side,
>> or did you forget to attach them?
>>
>> Thanks,
>> Harald
>>
>> On 4/7/23 09:07, Paul Richard Thomas via Gcc-patches wrote:
>>> Dear All,
>>>
>>> Please find attached a slightly updated version of the patch with a
>>> consolidated testcase. The three additional testcases are nothing to do
>>> with associate and test fixes of character related bugs.
>>>
>>> OK for mainline?
>>>
>>> Cheers
>>>
>>> Paul
>>> Fortran: Fix some of the bugs in associate [PR87477]
>>>
>>> 2023-04-07  Paul Thomas  <pault@gcc.gnu.org>
>>>
>>> gcc/fortran
>>> PR fortran/87477
>>> * resolve.cc (resolve_assoc_var): Handle parentheses around the
>>> target expression.
>>> (resolve_block_construct): Remove unnecessary static decls.
>>> * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
>>> expression in condition. Improve handling of string length and
>>> span, especially for substrings of the descriptor.
>>> (duplicate_allocatable): Make element type more explicit with
>>> 'eltype'.
>>> * trans_decl.cc (gfc_get_symbol_decl): Emit a fatal error with
>>> appropriate message instead of ICE if symbol type is unknown.
>>> * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
>>> 'previous' and use if end expression in substring reference is
>>> null.
>>> (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
>>> 'expr_flat' is an array.
>>> (gfc_trans_alloc_subarray_assign): If this is a deferred string
>>> length component, store the string length in the hidden comp.
>>> Update the typespec length accordingly. Generate a new type
>>> spec for the call to gfc_duplicate-allocatable in this case.
>>> * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
>>> deferred character array components.
>>>
>>>
>>> gcc/testsuite/
>>> PR fortran/87477
>>> * gfortran.dg/finalize_47.f90 : Enable substring test.
>>> * gfortran.dg/finalize_51.f90 : Update an error message.
>>>
>>> PR fortran/85686
>>> PR fortran/88247
>>> PR fortran/91941
>>> PR fortran/92779
>>> PR fortran/93339
>>> PR fortran/93813
>>> PR fortran/100948
>>> PR fortran/102106
>>> * gfortran.dg/associate_60.f90 : New test
>>>
>>> PR fortran/98408
>>> * gfortran.dg/pr98408.f90 : New test
>>>
>>> PR fortran/105205
>>> * gfortran.dg/pr105205.f90 : New test
>>>
>>> PR fortran/106918
>>> * gfortran.dg/pr106918.f90 : New test
>>
>>
>


WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: Re: Ping! [Patch, fortran] PR87477 - [meta-bug] [F03] issues concerning the ASSOCIATE statement
Date: Fri, 7 Apr 2023 21:28:57 +0200	[thread overview]
Message-ID: <1b87744e-5e9a-f932-21e8-64d122f74a5c@gmx.de> (raw)
Message-ID: <20230407192857.zjyta4HRAYjznBlGP7kZXj2AIzehUYEpkuN0RNeJzQo@z> (raw)
In-Reply-To: <CAGkQGiKT0-ppcJQuK3Mh1SLFNQDwGrsaH+BUKRvUiHsgqxGN=w@mail.gmail.com>

Hi Paul,

On 4/7/23 15:53, Paul Richard Thomas via Gcc-patches wrote:
> duuuh! Please find them attached.

the patch LGTM.  Thanks!

However, I have comments on the new testcase associate_60.f90:
subroutine pr93813 is missing an allocation of x, e.g.:

     allocate (t :: x)

otherwise it would be invalid.  Please check and fix.

Interestingly, subroutine pr92779 exhibits a small memory leak
with memory allocated by the spread intrinsic.  I played a little
and found that the leak depends on the presence of trim(): omitting
trim() removes the leak.  But looking at the related pr, it seems
that trim() was essential, so omitting it is likely not an option.

I think the best way is to proceed and to open a PR on the memory
leak rather than leaving pr92779 open.  What do you think?

Cheers,
Harald


> Thanks
> 
> Paul
> 
> 
> On Fri, 7 Apr 2023 at 10:41, Harald Anlauf <anlauf@gmx.de> wrote:
> 
>> Hi Paul,
>>
>> I don't see the new testcases.  Is this an issue on my side,
>> or did you forget to attach them?
>>
>> Thanks,
>> Harald
>>
>> On 4/7/23 09:07, Paul Richard Thomas via Gcc-patches wrote:
>>> Dear All,
>>>
>>> Please find attached a slightly updated version of the patch with a
>>> consolidated testcase. The three additional testcases are nothing to do
>>> with associate and test fixes of character related bugs.
>>>
>>> OK for mainline?
>>>
>>> Cheers
>>>
>>> Paul
>>> Fortran: Fix some of the bugs in associate [PR87477]
>>>
>>> 2023-04-07  Paul Thomas  <pault@gcc.gnu.org>
>>>
>>> gcc/fortran
>>> PR fortran/87477
>>> * resolve.cc (resolve_assoc_var): Handle parentheses around the
>>> target expression.
>>> (resolve_block_construct): Remove unnecessary static decls.
>>> * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
>>> expression in condition. Improve handling of string length and
>>> span, especially for substrings of the descriptor.
>>> (duplicate_allocatable): Make element type more explicit with
>>> 'eltype'.
>>> * trans_decl.cc (gfc_get_symbol_decl): Emit a fatal error with
>>> appropriate message instead of ICE if symbol type is unknown.
>>> * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
>>> 'previous' and use if end expression in substring reference is
>>> null.
>>> (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
>>> 'expr_flat' is an array.
>>> (gfc_trans_alloc_subarray_assign): If this is a deferred string
>>> length component, store the string length in the hidden comp.
>>> Update the typespec length accordingly. Generate a new type
>>> spec for the call to gfc_duplicate-allocatable in this case.
>>> * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
>>> deferred character array components.
>>>
>>>
>>> gcc/testsuite/
>>> PR fortran/87477
>>> * gfortran.dg/finalize_47.f90 : Enable substring test.
>>> * gfortran.dg/finalize_51.f90 : Update an error message.
>>>
>>> PR fortran/85686
>>> PR fortran/88247
>>> PR fortran/91941
>>> PR fortran/92779
>>> PR fortran/93339
>>> PR fortran/93813
>>> PR fortran/100948
>>> PR fortran/102106
>>> * gfortran.dg/associate_60.f90 : New test
>>>
>>> PR fortran/98408
>>> * gfortran.dg/pr98408.f90 : New test
>>>
>>> PR fortran/105205
>>> * gfortran.dg/pr105205.f90 : New test
>>>
>>> PR fortran/106918
>>> * gfortran.dg/pr106918.f90 : New test
>>
>>
> 



  reply	other threads:[~2023-04-07 19:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 21:04 Paul Richard Thomas
2023-03-29  8:24 ` Manfred Schwarb
2023-03-29  8:53   ` Paul Richard Thomas
2023-04-07  7:02     ` Paul Richard Thomas
2023-04-07  9:40       ` Harald Anlauf
2023-04-07  9:40         ` Harald Anlauf
2023-04-07  7:07 ` Ping! " Paul Richard Thomas
2023-04-07  9:41   ` Harald Anlauf
2023-04-07  9:41     ` Harald Anlauf
2023-04-07 13:53     ` Paul Richard Thomas
2023-04-07 19:28       ` Harald Anlauf [this message]
2023-04-07 19:28         ` Harald Anlauf
2023-04-07 21:35         ` Paul Richard Thomas
2023-04-07 21:38           ` Paul Richard Thomas
2023-04-08 13:56           ` Harald Anlauf
2023-04-08 13:56             ` 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=1b87744e-5e9a-f932-21e8-64d122f74a5c@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.com \
    /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).