public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andre Vehreschild <vehre@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>
Cc: GCC-Patches-ML <gcc-patches@gcc.gnu.org>,GCC-Fortran-ML
	<fortran@gcc.gnu.org>,Mikael Morin <mikael.morin@sfr.fr>
Subject: Re: [Patch, fortran, pr66578, v1] [F2008] Invalid free on allocate(...,source=a(:)) in block
Date: Mon, 06 Jul 2015 19:42:00 -0000	[thread overview]
Message-ID: <8551C1A9-7974-47F1-8F9D-F4CD5C611637@gmx.de> (raw)
In-Reply-To: <CAGkQGi+pw12_3y-Erb0T5E21zM8RcLPC1hUQHEabjPxczkC0gw@mail.gmail.com>

Hi Paul,

Thanks for the review, but I don't understand the regexp. rank_remap = ss->dimen < ndim != 0 in my eyes is not a legal expression. Did you mean something like rank_remap = ss->dimen < ndim && ndim != 0, or the like?

Regards,
Andre

Am 6. Juli 2015 21:36:18 MESZ, schrieb Paul Richard Thomas <paul.richard.thomas@gmail.com>:
>Dear Andre,
>
>Whilst it is probably OK in most circumstances, I would change:
>s/rank_remap = ss->dimen < ndim/rank_remap = ss->dimen < ndim != 0
>
>Apart from that, it is indeed OK for trunk, in spite of your
>expectations :-)
>
>Thanks for the patch
>
>Paul
>
>On 6 July 2015 at 14:58, Andre Vehreschild <vehre@gmx.de> wrote:
>> Hi all,
>>
>> this is a proposal to patch PR 66578
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66578 . It extends work
>of Mikael
>> Morin. The patch fixes two issues:
>>
>> 1. a source'd allocate in a block: allocate(c, source=a(:)). The
>issues occurs
>> because due to the new handling of source-expressions in
>trans_allocate() an
>> array descriptor is created where previously just a plain array was
>used. I.e.,
>> GFC_DESCRIPTOR_TYPE_P (source) is true now and GFC_ARRAY_TYPE_P
>(source) false,
>> which made gfortran use the wrong bounds for the descriptor
>(zero-based instead
>> of one-based). This was fixed by Mikael's proposal.
>>
>> 2. a two-level array addressing lead to a segfault. I.e., when in a
>> source-expression an array was used to index another object, then the
>offset
>> was computed incorrectly.
>>
>> Bootstraps and regtests fine on x86_64-linux-gnu/f21.
>>
>> Comments welcome!
>>
>> Regards,
>>         Andre
>>
>> PS: Experience shows that asking whether this ok for trunk is useless
>;-) There
>> is always something that could be improved. Open for suggestions.
>> --
>> Andre Vehreschild * Email: vehre ad gmx dot de

-- 
Andre Vehreschild * Kreuzherrenstr. 8 * 52062 Aachen
Mail: vehre@gmx.de * Tel.: +49 241 9291018

  reply	other threads:[~2015-07-06 19:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 12:58 Andre Vehreschild
2015-07-06 19:36 ` Paul Richard Thomas
2015-07-06 19:42   ` Andre Vehreschild [this message]
2015-07-06 19:55     ` Paul Richard Thomas
2015-07-07 11:11       ` 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=8551C1A9-7974-47F1-8F9D-F4CD5C611637@gmx.de \
    --to=vehre@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikael.morin@sfr.fr \
    --cc=paul.richard.thomas@gmail.com \
    /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).