public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paul.richard.thomas at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/64986] class_to_type_4.f90: valgrind error: Invalid read/write of size 8
Date: Thu, 23 Jul 2015 07:04:00 -0000 [thread overview]
Message-ID: <bug-64986-4-LT3x0yUSYE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64986-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64986
--- Comment #13 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Dear Mikael,
A good principle in general is to assume cock-up, rather than
conspiracy :-) The reason for this spreading between two functions is
incremental development done at very different times. If you can see a
way to rationalize the implementation, please do it.
Many thanks for the patch - assume that it is OK for trunk and 5.x
Paul
On 22 July 2015 at 18:24, mikael at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64986
>
> --- Comment #12 from Mikael Morin <mikael at gcc dot gnu.org> ---
> (In reply to Dominique d'Humieres from comment #6)
>> The test has been introduced at revision r220482,
>
> That revision adds interesting comments:
>
>> /* For a function with a class array result, save the result as
>> a temporary, set the info fields needed by the scalarizer and
>> call the finalization function of the temporary. Note that the
>> nullification of allocatable components needed by the result
>> is done in gfc_trans_assignment_1. */
>
> and in gfc_trans_assignment_1, there is:
>
>> /* Nullify the allocatable components corresponding to those of the lhs
>> derived type, so that the finalization of the function result does not
>> affect the lhs of the assignment. Prepend is used to ensure that the
>> nullification occurs before the call to the finalizer.
>
>
> So, if finalization for derived types with allocatable components means freeing
> the allocatable components, the above is more or less a justification for the
> patch in comment #9.
>
> What I don't understand is why there is need for two functions
> gfc_conv_procedure_call and gfc_trans_assignment_1 doing half of the job, and
> why deallocation of components, deallocation of whole allocatable and
> finalization are not handled all at once in a single place.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
next prev parent reply other threads:[~2015-07-23 7:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 18:29 [Bug fortran/64986] New: " ubizjak at gmail dot com
2015-02-09 18:31 ` [Bug fortran/64986] " ubizjak at gmail dot com
2015-02-13 10:37 ` dominiq at lps dot ens.fr
2015-02-13 15:33 ` paul.richard.thomas at gmail dot com
2015-02-16 15:36 ` dominiq at lps dot ens.fr
2015-04-03 0:10 ` hp at gcc dot gnu.org
2015-04-03 10:01 ` dominiq at lps dot ens.fr
2015-04-03 12:23 ` dominiq at lps dot ens.fr
2015-04-16 5:06 ` hp at gcc dot gnu.org
2015-07-18 13:24 ` mikael at gcc dot gnu.org
2015-07-21 10:02 ` dominiq at lps dot ens.fr
2015-07-22 16:24 ` mikael at gcc dot gnu.org
2015-07-23 7:04 ` paul.richard.thomas at gmail dot com [this message]
2015-07-24 13:55 ` mikael at gcc dot gnu.org
2015-07-24 14:45 ` mikael at gcc dot gnu.org
2015-07-24 19:47 ` mikael at gcc dot gnu.org
2015-07-25 19:20 ` mikael at gcc dot gnu.org
2015-07-25 19:23 ` mikael at gcc dot gnu.org
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=bug-64986-4-LT3x0yUSYE@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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).