This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ping, Patch, fortran, 64674, v3] [OOP] ICE in ASSOCIATE with class array
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Andre Vehreschild <vehre at gmx dot de>
- Cc: GCC-Patches-ML <gcc-patches at gcc dot gnu dot org>, GCC-Fortran-ML <fortran at gcc dot gnu dot org>
- Date: Mon, 22 Jun 2015 17:37:52 +0200
- Subject: Re: [Ping, Patch, fortran, 64674, v3] [OOP] ICE in ASSOCIATE with class array
- Authentication-results: sourceware.org; auth=none
- References: <20150504165315 dot 477b7f77 at gmx dot de> <20150519141855 dot 5520776d at vepi2> <20150619125842 dot 1ce38c52 at vepi2> <CAGkQGiLPoySExXqth0bN=9pSVsh8+AD1QxM-fkwheS4zZNAfJQ at mail dot gmail dot com> <20150622171526 dot 5c46732e at vepi2>
Dear Andre,
It was indeed the associate(pam => im(:, c)) that I had in mind. If
you have that working and in the tescase, that's good enough for me.
Cheers
Paul
On 22 June 2015 at 17:15, Andre Vehreschild <vehre@gmx.de> wrote:
> Hi Paul,
>
> On Mon, 22 Jun 2015 16:04:09 +0200
> Paul Richard Thomas <paul.richard.thomas@gmail.com> wrote:
>
>> Hi Andre,
>>
>> Some questions: The first and second chunks look a bit awkward in
>> parse.c. Do they have to be there in order that primary.c does the
>> right thing?
>
> I tried at first to do this rank resolution in primary.c, but that was too
> late. parse.c needs to propagate the rank correctly. When I remember correctly,
> then doing so later prevents parse.c to correctly recognize the vector (from
> the example in the initial description) as such, i.e., the indexing in
> vector(2) was not allowed. gfortran assumed vector to be scalar. So, IMHO yes.
>
>> Could the whole lot be transferred to resolve.c or would that make it
>> horribly messy?
>
> Again, IMO is it not easily transferable to primary.c or even resolve.c.
> Therefore no.
>
>> I couldn't apply the patch right now -
>> does it work with variable expressions for the target array indices?
>
> I am not quite sure, what you mean. Something like this:
>
> associate(pam => im(2:3, 2:3))
> pam = 9
> pam(1,2) = 10
> do c = 1, 2
> pam(2, c) = 0
> end do
> end associate
>
> ? I have added that to the testcase and it works. Or do you want the variable
> expressions in the target, like this:
>
> integer :: expect(20)= 23
> integer :: im(4,5) = 23
> integer :: c
>
> expect(2:3) = 9
> do c = 1, 5
> im = 23
> associate(pam => im(:, c))
> pam(2:3) = 9
> end associate
> if (any (reshape(im, [20]) /= expect)) call abort()
> ! Shift expect
> expect = [expect(17:), expect(:16)]
> end do
>
> Will this do, or did you have something more elaborate in mind? This is also
> working and in the testcase now.
>
> Thanks for the review so far.
>
> Regards,
> Andre
> --
> Andre Vehreschild * Email: vehre ad gmx dot de
--
Outside of a dog, a book is a man's best friend. Inside of a dog it's
too dark to read.
Groucho Marx
- References:
- Re: [Ping, Patch, fortran, 64674, v3] [OOP] ICE in ASSOCIATE with class array
- Re: [Ping, Patch, fortran, 64674, v3] [OOP] ICE in ASSOCIATE with class array
- From: Paul Richard Thomas
- Re: [Ping, Patch, fortran, 64674, v3] [OOP] ICE in ASSOCIATE with class array