public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/16946] New: sum (array, mask) is not accepted
@ 2004-08-09 16:59 schnetter at aei dot mpg dot de
  2004-08-09 17:06 ` [Bug fortran/16946] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-08-09 16:59 UTC (permalink / raw)
  To: gcc-bugs

It seems that gfortran does not accept the expression 
 
	sum (array, mask) 
 
The code 
 
program sum_mask 
  implicit none 
  logical :: equal(3) 
  integer :: itype 
  integer :: n 
  itype = sum((/(2**n, n=0, 2)/), equal) 
end program sum_mask 
 
is rejected with the error message 
 
$ ~/gcc/bin/gfortran -c sum_mask.f90  
 In file sum_mask.f90:6 
 
  itype = sum((/(2**n, n=0, 2)/), equal) 
                                1 
Error: Array index at (1) must be of INTEGER type 
 
 
 
According to my draft of Fortran 95, section 13.14.105, this should be legal.  
In my draft of Fortran 2k, section 13.5.12, this should also be legal.

-- 
           Summary: sum (array, mask) is not accepted
           Product: gcc
           Version: 3.5.0
            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
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
@ 2004-08-09 17:06 ` pinskia at gcc dot gnu dot org
  2004-08-09 17:24 ` schnetter at aei dot mpg dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-09 17:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-09 17:06 -------
This looks very much like PR 16907.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
  2004-08-09 17:06 ` [Bug fortran/16946] " pinskia at gcc dot gnu dot org
@ 2004-08-09 17:24 ` schnetter at aei dot mpg dot de
  2004-08-09 19:04 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-08-09 17:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schnetter at aei dot mpg dot de  2004-08-09 17:24 -------
I don't think that this PR and PR 16907 are related.  PR 16907 is about array 
index expressions that are not integer; this seems to be about an unrecognised 
intrinsic. 
 
Here, gfortran expects an array index, and complains because "equal" is not a 
scalar.  I assume that gfortran tries to match the intrinsic 
 
	sum (array, dim [, mask]) 
 
Instead, gfortran should realise that there is a different interface for the 
sum intrinsic, namely 
 
	sum (array [, mask]) 
 
which would match. 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
  2004-08-09 17:06 ` [Bug fortran/16946] " pinskia at gcc dot gnu dot org
  2004-08-09 17:24 ` schnetter at aei dot mpg dot de
@ 2004-08-09 19:04 ` pinskia at gcc dot gnu dot org
  2004-08-10 15:51 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-09 19:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-09 19:04 -------
Confirmed.

You are right the bugs are not related at all.

I thought I had saw a related bug though somewhere.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-09 19:04:55
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
                   ` (2 preceding siblings ...)
  2004-08-09 19:04 ` pinskia at gcc dot gnu dot org
@ 2004-08-10 15:51 ` pinskia at gcc dot gnu dot org
  2004-08-19 15:31 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-10 15:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-10 15:51 -------
http://gcc.gnu.org/ml/fortran/2004-08/msg00056.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
                   ` (3 preceding siblings ...)
  2004-08-10 15:51 ` pinskia at gcc dot gnu dot org
@ 2004-08-19 15:31 ` cvs-commit at gcc dot gnu dot org
  2004-08-19 15:34 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-19 15:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-19 15:31 -------
Subject: Bug 16946

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-08-19 15:31:37

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/fortran    : check.c gfortran.h intrinsic.c intrinsic.h 
	                 iresolve.c 
Added files:
	gcc/testsuite/gfortran.dg: reduction.f90 

Log message:
	fortran/
	PR fortran/16946
	* check.c (gfc_check_reduction): New function.
	(gfc_check_minval_maxval): Removed.
	(gfc_check_product): Removed.
	(gfc_check_sum): Removed.
	* intrinsic.h: Add/remove declarations for these.
	* gfortran.h: Add field f3red to union gfc_check_f.
	* intrinsic.c (add_sym_3red): New function.
	(add_functions): Register maxval, minval, product, and sum intrinsics
	through add_sym_3red.
	(check_specific): Handle f3red union field.
	* iresolve.c: Whitespace change.
	
	testsuite/
	PR fortran/16946
	* gfortran.dg/reduction.f90: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4159&r2=1.4160
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/reduction.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/check.c.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.23&r2=1.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&r1=1.15&r2=1.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.h.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/iresolve.c.diff?cvsroot=gcc&r1=1.10&r2=1.11



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
                   ` (4 preceding siblings ...)
  2004-08-19 15:31 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-19 15:34 ` tobi at gcc dot gnu dot org
  2004-08-19 15:36 ` pinskia at gcc dot gnu dot org
  2004-08-19 22:30 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-19 15:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-19 15:34 -------
Fixed, Erik's patch is now in the CVS.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
                   ` (5 preceding siblings ...)
  2004-08-19 15:34 ` tobi at gcc dot gnu dot org
@ 2004-08-19 15:36 ` pinskia at gcc dot gnu dot org
  2004-08-19 22:30 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-19 15:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/16946] sum (array, mask) is not accepted
  2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
                   ` (6 preceding siblings ...)
  2004-08-19 15:36 ` pinskia at gcc dot gnu dot org
@ 2004-08-19 22:30 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-19 22:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-19 22:30 -------
Subject: Bug 16946

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-08-19 22:30:02

Modified files:
	gcc/fortran    : ChangeLog 

Log message:
	Commit previously forgotten ChangeLog diffs for this patch:
	PR fortran/16946
	* check.c (gfc_check_reduction): New function.
	(gfc_check_minval_maxval): Removed.
	(gfc_check_product): Removed.
	(gfc_check_sum): Removed.
	* intrinsic.h: Add/remove declarations for these.
	* gfortran.h: Add field f3red to union gfc_check_f.
	* intrinsic.c (add_sym_3red): New function.
	(add_functions): Register maxval, minval, product, and sum intrinsics
	through add_sym_3red.
	(check_specific): Handle f3red union field.
	* iresolve.c: Whitespace change.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.156&r2=1.157



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-08-19 22:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 16:59 [Bug fortran/16946] New: sum (array, mask) is not accepted schnetter at aei dot mpg dot de
2004-08-09 17:06 ` [Bug fortran/16946] " pinskia at gcc dot gnu dot org
2004-08-09 17:24 ` schnetter at aei dot mpg dot de
2004-08-09 19:04 ` pinskia at gcc dot gnu dot org
2004-08-10 15:51 ` pinskia at gcc dot gnu dot org
2004-08-19 15:31 ` cvs-commit at gcc dot gnu dot org
2004-08-19 15:34 ` tobi at gcc dot gnu dot org
2004-08-19 15:36 ` pinskia at gcc dot gnu dot org
2004-08-19 22:30 ` cvs-commit 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).