From: Andre Vehreschild <vehre@gmx.de>
To: Mikael Morin <mikael.morin@sfr.fr>
Cc: GCC-Fortran-ML <fortran@gcc.gnu.org>,
GCC-Patches-ML <gcc-patches@gcc.gnu.org>,
Antony Lewis <antony@cosmologist.info>
Subject: Re: [Patch 1/2, Fortran, pr60322] [OOP] Incorrect bounds on polymorphic dummy array
Date: Mon, 23 Mar 2015 15:49:00 -0000 [thread overview]
Message-ID: <20150323164943.76daeabe@vepi2> (raw)
In-Reply-To: <551029F7.4080601@sfr.fr>
Hi Mikael,
> This pointer stuff is very difficult to swallow to me.
I totally understand. When doing the patch I had to restart twice, because I
mixed up the development on the class arrays so completely, that I couldn't get
it right again.
> I understand that for classes, the CLASS_DATA (sym)->pointer is always
> set, but almost everywhere the checks for pointerness are like
> (sym->ts.type != BT_CLASS && sym->attr.pointer)
> || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.class_pointer)
> and I don't see a convincing reason to have it different here.
I see your point. Currently I am bootstraping and regtesting some patches for
commit. While this is running, my machine is nearly unusable. I will look into
this as soon, as my machine allows, but probably not before tomorrow.
> At least gfc_is_nodesc_array should return 0 if sym->ts.type == BT_CLASS
> which solves the problem there; for the other cases, I think that
> class_pointer should be looked at. gfc_build_class_symbol clears the
> sym->attr.pointer flag for class containers so it doesn't make sense to
> test that flag.
Completely right again. But I figured, that because sym->attr.pointer is never
set for BT_CLASS there is no harm to check it and furthermore no need to guard
it by checking whether ts.type == BT_CLASS. Fortunately not checking for
class_pointer in _data's attr, didn't throw any regressions. Thinking about it
now, I also think that it is probably safer to add the check for the
class_pointer attribute were attr.pointer is checked on the sym, having the
expression like you pointed out:
> (sym->ts.type != BT_CLASS && sym->attr.pointer)
> || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.class_pointer)
Regards,
Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de
next prev parent reply other threads:[~2015-03-23 15:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 17:19 Andre Vehreschild
2015-03-23 12:29 ` Mikael Morin
2015-03-23 12:44 ` Andre Vehreschild
2015-03-23 14:58 ` Mikael Morin
2015-03-23 15:49 ` Andre Vehreschild [this message]
2015-03-23 19:28 ` Mikael Morin
2015-03-24 10:13 ` Paul Richard Thomas
2015-03-24 17:06 ` [Patch, Fortran, pr60322] was: " Andre Vehreschild
2015-03-25 9:43 ` Dominique d'Humières
2015-03-25 16:57 ` Andre Vehreschild
2015-03-26 9:27 ` Dominique d'Humières
2015-03-27 12:48 ` Paul Richard Thomas
2015-04-05 9:13 ` Paul Richard Thomas
2015-04-09 12:37 ` Andre Vehreschild
2015-04-14 17:01 ` [Patch, Fortran, pr60322, addendum] " Andre Vehreschild
2015-04-16 19:13 ` Paul Richard Thomas
2015-04-23 11:34 ` [commited, Patch, " Andre Vehreschild
2015-04-27 17:43 ` Andre Vehreschild
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=20150323164943.76daeabe@vepi2 \
--to=vehre@gmx.de \
--cc=antony@cosmologist.info \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=mikael.morin@sfr.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).