This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR40196 - [F03] [F08] Type parameter inquiry (str%len, a%kind) and Complex parts (z%re, z%im)
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, mexas at bristol dot ac dot uk
- Date: Sun, 28 Oct 2018 11:31:10 +0000
- Subject: Re: [Patch, fortran] PR40196 - [F03] [F08] Type parameter inquiry (str%len, a%kind) and Complex parts (z%re, z%im)
- References: <CAGkQGiJXe216tKYS8-MSvbFNuvTSUFFbh6UHq33tgWx6qYEJ7Q@mail.gmail.com> <20181028101614.49dad237@nbbrfq.loc>
Hi Bernhard,
Thanks for going through the patch:
....snip....
> missing space before open parenthesis
Corrected.
....snip....
> inq would be easier to understand and unambiguous imho.
Why? inquiry_type seems fine to me.
....snip....
> Is the switch really worth it? I'd have used a plain chain of strcmp,
> fwiw.
I have done it. However, I might revert in order to combine the switch
block where I set the typespec for the primary expression.
....snip....
> I guess RE and IM should be capitalised?
Done
> you could break here
>
> > +
> > for (ref = expr->ref; ref; ref = ref->next)
> > switch (ref->type)
> > {
Done
>
> > Index: gcc/fortran/trans-expr.c
....snip...
> Don't you have to gfc_free_expr (se->expr) or gfc_replace_expr() ?
No these are tree expressions not gfc_expr. No cleanup is needed.
I haven't added testcases for errors. Does anybody think that this is necessary?
Cheers
Paul