[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-02-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Paul Thomas  ---
Fixed on 8- and 9-branches.

Thanks for the report.

Paul

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-02-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

--- Comment #8 from Paul Thomas  ---
Author: pault
Date: Sun Feb  3 14:40:17 2019
New Revision: 268487

URL: https://gcc.gnu.org/viewcvs?rev=268487=gcc=rev
Log:
2019-02-03  Paul Thomas  

Backport from trunk
PR fortran/88685
* expr.c (is_subref_array): Move the check for class pointer
dummy arrays to after the reference check. If we haven't seen
an array reference other than an element and a component is not
class or derived, return false.

2019-02-03  Paul Thomas  

Backport from trunk
PR fortran/88685
* gfortran.dg/pointer_array_component_3.f90 : New test.


Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-02-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

--- Comment #7 from Paul Thomas  ---
Author: pault
Date: Sun Feb  3 14:37:08 2019
New Revision: 268486

URL: https://gcc.gnu.org/viewcvs?rev=268486=gcc=rev
Log:
2019-02-02  Paul Thomas  

PR fortran/88685
* expr.c (is_subref_array): Move the check for class pointer
dummy arrays to after the reference check. If we haven't seen
an array reference other than an element and a component is not
class or derived, return false.

2019-02-02  Paul Thomas  

PR fortran/88685
* gfortran.dg/pointer_array_component_3.f90 : New test.


Added:
   
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pointer_array_component_3.f90
Modified:
branches/gcc-8-branch/gcc/fortran/expr.c

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-02-02 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

--- Comment #6 from Paul Thomas  ---
Author: pault
Date: Sat Feb  2 09:10:58 2019
New Revision: 268472

URL: https://gcc.gnu.org/viewcvs?rev=268472=gcc=rev
Log:
2019-02-02  Paul Thomas  

PR fortran/88685
* expr.c (is_subref_array): Move the check for class pointer
dummy arrays to after the reference check. If we haven't seen
an array reference other than an element and a component is not
class or derived, return false.

2019-02-02  Paul Thomas  

PR fortran/88685
* gfortran.dg/pointer_array_component_3.f90 : New test.


Added:
trunk/gcc/testsuite/gfortran.dg/pointer_array_component_3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-27 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #5 from Paul Thomas  ---
It's mine - ***sigh***

Paul

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

Richard Biener  changed:

   What|Removed |Added

Version|unknown |8.2.1
   Target Milestone|--- |8.3

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-04 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

--- Comment #4 from Steve Kargl  ---
On Fri, Jan 04, 2019 at 09:40:52AM +, antony at cosmologist dot info wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685
> 
> --- Comment #2 from Antony Lewis  ---
> I think the individual elements are correct, it's the array indexing 
> operations
> that are wrong (this is clearer in the longer example; looks a like wrong
> stride). E.g. printing this in the main program after calling doit
> 

Ah, yeah, that is what my small change to doit() shows.

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-04 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

Dominique d'Humieres  changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||pault at gcc dot gnu.org

--- Comment #3 from Dominique d'Humieres  ---
Likely caused by r251949 (r251946 is OK, r251980 is not).

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-04 Thread antony at cosmologist dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

--- Comment #2 from Antony Lewis  ---
I think the individual elements are correct, it's the array indexing operations
that are wrong (this is clearer in the longer example; looks a like wrong
stride). E.g. printing this in the main program after calling doit

print *, arr(1,1)%CL

also gives 1, -1, -1.

[Bug fortran/88685] [8/9 regression] pointer class array argument indexing

2019-01-03 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88685

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-01-04
 CC||kargl at gcc dot gnu.org
  Known to work||7.4.1
 Ever confirmed|0   |1
  Known to fail||8.2.1, 9.0

--- Comment #1 from kargl at gcc dot gnu.org ---
Interesting bug.  Changing doit() to

  subroutine doit(cls)
 class(tarr), pointer :: cls(:,:)
 cls(1,1)%cl = 1
 print *, 'cl   = ', cls(1,1)%cl
 print *, 'cl(i)= ', cls(1,1)%cl(1:3)
 print *, 'cl(i)= ', cls(1,1)%cl(1:1),cls(1,1)%cl(2:2),cls(1,1)%cl(3:3)
 print *, 'cl(i)= ', cls(1,1)%cl(1),cls(1,1)%cl(2),cls(1,1)%cl(3)
  end subroutine doit

shows that the issue involves the reference individual elements.  With
gfortran 7.4.1, get

% gfc7 -o z a.f90 && ./z
 cl   =1   1   1
 cl(i)=1   1   1
 cl(i)=1   1   1
 cl(i)=1   1   1

with 8.2.1 and 9.0 I get

% gfc8 -o z a.f90 && ./z
 cl   =1   1   1
 cl(i)=1   1   1
 cl(i)=1   1   1
 cl(i)=1  -1  -1