public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Richard Thomas <paul.richard.thomas@gmail.com>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Paul Richard Thomas via Fortran <fortran@gcc.gnu.org>,
	Harald Anlauf <anlauf@gmx.de>,
	 gcc-patches <gcc-patches@gcc.gnu.org>,
	Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject: Re: [Patch, fortran] PR107900 Select type with intrinsic type inside associate causes ICE / Segmenation fault
Date: Thu, 22 Jun 2023 07:19:37 +0100	[thread overview]
Message-ID: <CAGkQGiKsyVvAkO7KJGnXBJitZtx1u2OWcEKBFcvkz9gjKhAf8A@mail.gmail.com> (raw)
In-Reply-To: <20230621211747.7d4a0dc9@nbbrfq.loc>

Hi Both,

> while I only had a minor question regarding gfc_is_ptr_fcn(),
> can you still try to enlighten me why that second part
> was necessary?  (I believed it to be redundant and may have
> overlooked the obvious.)

Blast! I forgot about checking that. Lurking in the back of my mind
and going back to the first days of OOP in gfortran is a distinction
between a class entity with the pointer attribute and one whose data
component has the class_pointer attribute. I'll check it out and do
whatever is needed.


> > +      else if (context && gfc_is_ptr_fcn (assoc->target))
> > +     {
> > +       if (!gfc_notify_std (GFC_STD_F2018, "%qs at %L associated to "
> > +                            "pointer function target being used in a "
> > +                            "variable definition context (%s)", name,
> > +                            &e->where, context))
>
> I'm curious why you decided to put context in braces and not simply use
> quotes as per %qs?

That's the way it's done in the preceding errors. I had to keep the
context in context, so to speak.

> > +/* Build the associate name  */
> > +static int
> > +build_associate_name (const char *name, gfc_expr **e1, gfc_expr **e2)
> > +{
>
> > +    return 1;
>
> > +  return 0;
> > +}
>
> I've gone through the frontend recently and changed several such
> boolean functions to use bool where appropriate. May i ask folks to use
> narrower types in new code, please?
> Iff later in the pipeline it is considered appropriate or benefical to
> promote types, these will eventually be promoted.
>
> > diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
> > index e6a4337c0d2..18589e17843 100644
> > --- a/gcc/fortran/trans-decl.cc
> > +++ b/gcc/fortran/trans-decl.cc
>
> > @@ -1906,6 +1915,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
> >       gcc_assert (!sym->value || sym->value->expr_type == EXPR_NULL);
> >      }
> >
> > +
>

'twas accidental. There had previously been another version of the fix
that I commented out and the extra line crept in when I deleted it.
Thanks for the spot.

>
> Please kindly excuse my comment and, again, thanks!
>
> >    gfc_finish_var_decl (decl, sym);
> >
> >    if (sym->ts.type == BT_CHARACTER)

Regards

Paul

      reply	other threads:[~2023-06-22  6:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  9:14 Paul Richard Thomas
2023-06-17 15:33 ` Steve Kargl
2023-06-17 18:01 ` Harald Anlauf
2023-06-18  7:54   ` Paul Richard Thomas
2023-06-20 10:54     ` Paul Richard Thomas
2023-06-20 21:57       ` Harald Anlauf
2023-06-21 16:12         ` Paul Richard Thomas
2023-06-21 16:46           ` Steve Kargl
2023-06-21 18:40           ` Harald Anlauf
2023-06-21 19:17       ` Bernhard Reutner-Fischer
2023-06-22  6:19         ` Paul Richard Thomas [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=CAGkQGiKsyVvAkO7KJGnXBJitZtx1u2OWcEKBFcvkz9gjKhAf8A@mail.gmail.com \
    --to=paul.richard.thomas@gmail.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rep.dot.nop@gmail.com \
    --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).