--- Comment #7 from pault at gcc dot gnu dot org 2007-05-07 05:44 ---
The patch below works and regtests. Before submitting it, however, I would
like to understand why I could not persuade the use of the repeat count to
work, rather than expanding to a full array.
Paul
Index: gcc/fort
--- Comment #6 from pault at gcc dot gnu dot org 2007-04-13 23:24 ---
This cures the problem but is otherwise untested.
Paul
Index: gcc/fortran/decl.c
===
*** gcc/fortran/decl.c (revision 123793)
--- gcc/fortran/decl.c (
--- Comment #5 from pault at gcc dot gnu dot org 2007-04-13 22:26 ---
INTEGER :: K(3)=1
INTEGER, PARAMETER :: J(3)=(/1,2,0/)
write(6,*) MAXLOC(K,J<1)
END
works just fine. I would say that the problem is that the initializtion
expression is never getting turned into an EXPR_ARRAY.
Paul
--- Comment #4 from tkoenig at gcc dot gnu dot org 2007-03-17 15:27 ---
*** Bug 31206 has been marked as a duplicate of this bug. ***
--
tkoenig at gcc dot gnu dot org changed:
What|Removed |Added
---
--- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-02-09 22:42
---
When we enter into gfc_trans_transfer, we have the following:
if (ss == gfc_ss_terminator)
{
/* Transfer a scalar value. */
and we come here with a EXPR_CONST array, for which ss is set to
gfc_ss_te
--- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-02-06 14:05
---
We're passing a pointer to a logical instead of an array descriptor:
$ cat a.f90
integer :: k(3), l(1)
integer, parameter :: j(3) = 2
l = maxloc (k, j<1)
end
$ cat a.f90.003t.original
MAIN_
--- Comment #1 from tkoenig at gcc dot gnu dot org 2006-10-25 20:39 ---
This is not a maxloc bug per se. Look at this:
$ cat a9.f90
INTEGER :: K(3)=1
INTEGER, PARAMETER :: J(3)=2
write (6,*) J<1
END
$ gfortran -fdump-tree-original a9.f90
$ ./a.out
F
Output should be
F F F
instead.