public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/14928] New: minval intrinsic does not understand mask
@ 2004-04-12 21:12 schnetter at aei dot mpg dot de
2004-04-12 21:52 ` [Bug fortran/14928] [gfortran] " pinskia at gcc dot gnu dot org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-04-12 21:12 UTC (permalink / raw)
To: gcc-bugs
The minval intrinsic can take an optional mask argument. However, the
following code produces an error:
subroutine a (b, c)
implicit none
double precision b(10)
integer c
c = minloc (b, b<0)
end subroutine a
The error is
In file minloc.f90:5
c = minloc (b, b<0)
1
Error: Array index at (1) must be of INTEGER type
Apparently, gfortran expects this to be a "dim" dimension specifier and not a
mask.
--
Summary: minval intrinsic does not understand mask
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
@ 2004-04-12 21:52 ` pinskia at gcc dot gnu dot org
2004-04-13 4:14 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-12 21:52 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Summary|minval intrinsic does not |[gfortran] minval intrinsic
|understand mask |does not understand mask
Target Milestone|--- |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
2004-04-12 21:52 ` [Bug fortran/14928] [gfortran] " pinskia at gcc dot gnu dot org
@ 2004-04-13 4:14 ` pinskia at gcc dot gnu dot org
2004-04-13 10:11 ` schnetter at aei dot mpg dot de
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-13 4:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-13 01:59 -------
IFC gives an error also:
external subroutine A
c = minloc (b, b<0)
^
Error 161 at (6:pr14928.f90) : Expression shape conformance violation
1 Error
compilation aborted for pr14928.f90 (code 1)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
2004-04-12 21:52 ` [Bug fortran/14928] [gfortran] " pinskia at gcc dot gnu dot org
2004-04-13 4:14 ` pinskia at gcc dot gnu dot org
@ 2004-04-13 10:11 ` schnetter at aei dot mpg dot de
2004-04-13 12:37 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-04-13 10:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schnetter at aei dot mpg dot de 2004-04-13 08:23 -------
I sent an illegal programme. The corrected programme declares c as array, as
follows:
subroutine a (b, c)
implicit none
double precision b(10)
integer c(1)
c = minloc (b, b<0)
end subroutine a
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (2 preceding siblings ...)
2004-04-13 10:11 ` schnetter at aei dot mpg dot de
@ 2004-04-13 12:37 ` pinskia at gcc dot gnu dot org
2004-05-26 23:07 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-13 12:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-13 11:19 -------
Confirmed with the correct sample.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-04-13 11:19:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (3 preceding siblings ...)
2004-04-13 12:37 ` pinskia at gcc dot gnu dot org
@ 2004-05-26 23:07 ` pinskia at gcc dot gnu dot org
2004-06-03 18:38 ` tobi at gcc dot gnu dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-26 23:07 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.5.0 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (4 preceding siblings ...)
2004-05-26 23:07 ` pinskia at gcc dot gnu dot org
@ 2004-06-03 18:38 ` tobi at gcc dot gnu dot org
2004-06-03 22:07 ` schnetter at uni-tuebingen dot de
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-06-03 18:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2004-06-03 18:38 -------
Isn't "MASK=" required?
subroutine a (b, c)
implicit none
double precision b(10)
integer c(1)
c = minloc (b, mask=b<0)
end subroutine a
compiles without problem.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (5 preceding siblings ...)
2004-06-03 18:38 ` tobi at gcc dot gnu dot org
@ 2004-06-03 22:07 ` schnetter at uni-tuebingen dot de
2004-06-03 22:23 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: schnetter at uni-tuebingen dot de @ 2004-06-03 22:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schnetter at uni-tuebingen dot de 2004-06-03 22:07 -------
To my knowledge, the optional argument "mask" may be passed without using the
"mask=" syntax. I have looked into the September 2002 draft of the Fortran
200x standard, which, I believe, is in this respect very similar to the
Fortran 95 standard. Apart from explaining things in section 12.4.1, it gives
an example in note 13.2, listing the allowable calling syntaxes for CMPLX,
which also has two optional arguments. From that it is clear that optional
arguments may be given without the "name=" syntax essentially as long as all
optional arguments before this one are also present.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (6 preceding siblings ...)
2004-06-03 22:07 ` schnetter at uni-tuebingen dot de
@ 2004-06-03 22:23 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-06-04 8:04 ` schnetter at uni-tuebingen dot de
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Tobias dot Schlueter at physik dot uni-muenchen dot de @ 2004-06-03 22:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de 2004-06-03 22:23 -------
Subject: Re: [gfortran] minval intrinsic does not understand
mask
schnetter at uni-tuebingen dot de wrote:
> Fortran 95 standard. Apart from explaining things in section 12.4.1, it gives
> an example in note 13.2, listing the allowable calling syntaxes for CMPLX,
> which also has two optional arguments. From that it is clear that optional
> arguments may be given without the "name=" syntax essentially as long as all
> optional arguments before this one are also present.
Yes, but note that (in the Fortran 95 draft standard) CMPLX is specified as
CMPLX (X[, Y, KIND])
and MAXLOC as
MAXLOC (ARRAY, DIM[, MASK]) or MASK (ARRAY[, MASK])
(sic)
So MAXLOC is somewhat special. Furthermore in all examples for MAXLOC,
"MASK=" is spelled out if the argument is present. I will look into this
in more detail tomorrow.
- Tobi
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (7 preceding siblings ...)
2004-06-03 22:23 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
@ 2004-06-04 8:04 ` schnetter at uni-tuebingen dot de
2004-06-04 22:40 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: schnetter at uni-tuebingen dot de @ 2004-06-04 8:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schnetter at uni-tuebingen dot de 2004-06-04 08:03 -------
Section 13.2, "Arguments to intrinsic procedures" of the same draft, specifies
that "the valid forms of reference for procedures with optional arguments are
described in 12.4.1". 12.4.1 in turn describes "normal" (non-intrinsic)
procedure calls, where the "name=" syntax is not compulsory.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minval intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (8 preceding siblings ...)
2004-06-04 8:04 ` schnetter at uni-tuebingen dot de
@ 2004-06-04 22:40 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-06-05 13:11 ` [Bug fortran/14928] [gfortran] minloc " tobi at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Tobias dot Schlueter at physik dot uni-muenchen dot de @ 2004-06-04 22:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de 2004-06-04 22:40 -------
Subject: Re: [gfortran] minval intrinsic does not understand
mask
schnetter at uni-tuebingen dot de wrote:
> ------- Additional Comments From schnetter at uni-tuebingen dot de 2004-06-04 08:03 -------
> Section 13.2, "Arguments to intrinsic procedures" of the same draft, specifies
> that "the valid forms of reference for procedures with optional arguments are
> described in 12.4.1". 12.4.1 in turn describes "normal" (non-intrinsic)
> procedure calls, where the "name=" syntax is not compulsory.
While I see a way to bend the words to support the position that the
"MASK=" keyword is mandatory, I agree with your reading. I've just
ported over the changes in g95 to support this and will submit them for
review tomorrow.
- Tobi
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minloc intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (9 preceding siblings ...)
2004-06-04 22:40 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
@ 2004-06-05 13:11 ` tobi at gcc dot gnu dot org
2004-06-14 15:56 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-06-05 13:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2004-06-05 13:11 -------
Fixed the summary s/val/loc/. Patch here:
http://gcc.gnu.org/ml/fortran/2004-06/msg00026.html
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[gfortran] minval intrinsic |[gfortran] minloc intrinsic
|does not understand mask |does not understand mask
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minloc intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (10 preceding siblings ...)
2004-06-05 13:11 ` [Bug fortran/14928] [gfortran] minloc " tobi at gcc dot gnu dot org
@ 2004-06-14 15:56 ` cvs-commit at gcc dot gnu dot org
2004-06-14 16:06 ` tobi at gcc dot gnu dot org
2004-07-10 0:45 ` [Bug fortran/14928] " pinskia at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-14 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-06-14 15:56 -------
Subject: Bug 14928
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: tobi@gcc.gnu.org 2004-06-14 15:56:50
Modified files:
gcc/fortran : ChangeLog check.c gfortran.h intrinsic.c
intrinsic.h
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gfortran.fortran-torture/compile: mloc.f90
Log message:
fortran/
2004-06-05 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
Andrew Vaught <andyv@firstinter.net>
PR fortran/14928
* gfortran.h (gfc_check_f): Add new field f3ml.
* check.c (gfc_check_minloc_maxloc): Take argument list instead
of individual arguments, reorder if necessary.
* intrinsic.h (gfc_check_minloc_maxloc): ... adapt prototype.
* intrinsic.c (add_sym_3ml): New function.
(add_functions): Change to add_sym_3ml for MINLOC, MAXLOC.
(check_specific): Catch special case MINLOC, MAXLOC.
testsuite/
PR fortran/14928
* gfortran.fortran-torture/compile/mloc.f90: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.71&r2=1.72
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/check.c.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.12&r2=1.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.h.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3853&r2=1.3854
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/compile/mloc.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] [gfortran] minloc intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (11 preceding siblings ...)
2004-06-14 15:56 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-14 16:06 ` tobi at gcc dot gnu dot org
2004-07-10 0:45 ` [Bug fortran/14928] " pinskia at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-06-14 16:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2004-06-14 16:06 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/14928] minloc intrinsic does not understand mask
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
` (12 preceding siblings ...)
2004-06-14 16:06 ` tobi at gcc dot gnu dot org
@ 2004-07-10 0:45 ` pinskia at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-10 0:45 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14928
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2004-07-10 0:45 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-12 21:12 [Bug fortran/14928] New: minval intrinsic does not understand mask schnetter at aei dot mpg dot de
2004-04-12 21:52 ` [Bug fortran/14928] [gfortran] " pinskia at gcc dot gnu dot org
2004-04-13 4:14 ` pinskia at gcc dot gnu dot org
2004-04-13 10:11 ` schnetter at aei dot mpg dot de
2004-04-13 12:37 ` pinskia at gcc dot gnu dot org
2004-05-26 23:07 ` pinskia at gcc dot gnu dot org
2004-06-03 18:38 ` tobi at gcc dot gnu dot org
2004-06-03 22:07 ` schnetter at uni-tuebingen dot de
2004-06-03 22:23 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-06-04 8:04 ` schnetter at uni-tuebingen dot de
2004-06-04 22:40 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-06-05 13:11 ` [Bug fortran/14928] [gfortran] minloc " tobi at gcc dot gnu dot org
2004-06-14 15:56 ` cvs-commit at gcc dot gnu dot org
2004-06-14 16:06 ` tobi at gcc dot gnu dot org
2004-07-10 0:45 ` [Bug fortran/14928] " pinskia at gcc dot gnu dot org
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).