public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Richard Thomas <paul.richard.thomas@gmail.com>
To: Harald Anlauf <anlauf@gmx.de>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject: Re: [Patch, fortran] Fix default type bugs in gfortran [PR99139, PR99368]
Date: Sat, 8 Jul 2023 18:15:36 +0100	[thread overview]
Message-ID: <CAGkQGiKrWRyB0Ts3cTi6Mpqse49djE2fKbNOj+J29R1PZQXnVA@mail.gmail.com> (raw)
In-Reply-To: <bf698c78-348c-79ad-f16a-cc8906ad181c@gmx.de>

Hi Harald,

I don't believe that a memory leak is possible since tmp is only
non-null if it points to an existing symbol. I agree with you about
the style but have to plead innocence because I am not the author :-)
I will change it though.

Thanks for the nit, Steve.

Pushed as r14-2397-g9a2eab6172a8067e2f63e0fa2bcd5b2190656303

Paul

On Sat, 8 Jul 2023 at 15:46, Harald Anlauf <anlauf@gmx.de> wrote:
>
> Hi Paul,
>
> thanks for taking this.
>
> I have just a minor comment regards coding style:
>
> +                 if (tmp
> +                     && tmp->attr.generic
> +                     && (tmp = gfc_find_dt_in_generic (tmp)))
> +                   {
> +                     if (tmp->attr.flavor == FL_DERIVED)
>
> My reading of the guidelines says that I should rather write
>
>    if (tmp && tmp->attr.generic)
>      {
>        tmp = gfc_find_dt_in_generic (tmp);
>        if (tmp && tmp->attr.flavor == FL_DERIVED)
>
> Both variants are equally readable, though.
>
> I haven't though long enough about possible minor memleaks,
> i.e. if a freeing of gfc_symbol tmp is advised.
> Running f951 under valgrind might give you a hint.
>
> Thanks,
> Harald
>
>
> Am 08.07.23 um 16:23 schrieb Paul Richard Thomas via Gcc-patches:
> > The attached patch incorporates two of Steve's "Orphaned Patches" -
> > https://gcc.gnu.org/pipermail/fortran/2023-June/059423.html
> >
> > They have in common that they both involve faults in use of default
> > type and that I was the ultimate cause of the bugs.
> >
> > The patch regtests with the attached testcases.
> >
> > I will commit in the next 24 hours unless there are any objections.
> >
> > Paul
> >
> > Fortran: Fix default type bugs in gfortran [PR99139, PR99368]
> >
> > 2023-07-08  Steve Kargl  <sgk@troutmask.apl.washington.edu>
> >
> > gcc/fortran
> > PR fortran/99139
> > PR fortran/99368
> > * match.cc (gfc_match_namelist): Check for host associated or
> > defined types before applying default type.
> > (gfc_match_select_rank): Apply default type to selector of
> > unlnown type if possible.
> > * resolve.cc (resolve_fl_variable): Do not apply local default
> > initialization to assumed rank entities.
> >
> > gcc/testsuite/
> > PR fortran/999139
> > * gfortran.dg/pr99139.f90 : New test
> >
> > PR fortran/99368
> > * gfortran.dg/pr99368.f90 : New test
> >
> > Fortran: Fix default type bugs in gfortran [PR99139, PR99368]
> >
> > 2023-07-08  Steve Kargl  <sgk@troutmask.apl.washington.edu>
> >
> > gcc/fortran
> > PR fortran/99139
> > PR fortran/99368
> > * match.cc (gfc_match_namelist): Check for host associated or
> > defined types before applying default type.
> > (gfc_match_select_rank): Apply default type to selector of
> > unlnown type if possible.
> > * resolve.cc (resolve_fl_variable): Do not apply local default
> > initialization to assumed rank entities.
> >
> > gcc/testsuite/
> > PR fortran/999139
> > * gfortran.dg/pr99139.f90 : New test
> >
> > PR fortran/99368
> > * gfortran.dg/pr99368.f90 : New test
>


-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein

  reply	other threads:[~2023-07-08 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-08 14:23 Paul Richard Thomas
2023-07-08 14:46 ` Harald Anlauf
2023-07-08 17:15   ` Paul Richard Thomas [this message]
2023-07-08 14:57 ` Steve Kargl

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=CAGkQGiKrWRyB0Ts3cTi6Mpqse49djE2fKbNOj+J29R1PZQXnVA@mail.gmail.com \
    --to=paul.richard.thomas@gmail.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).