public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25095]  New: better diagnostic needed
@ 2005-11-26 18:06 jv244 at cam dot ac dot uk
  2006-06-04  9:52 ` [Bug fortran/25095] Disallowed intrinsic in initialization statement fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 18:06 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

INTEGER :: i(10)
DATA (i(MODULO(j,5)),j=1,4) /4*0/
END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2006-06-04  9:52 ` fxcoudert at gcc dot gnu dot org
  2006-06-04 10:43 ` jv244 at cam dot ac dot uk
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-06-04  9:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2006-06-04 09:52 -------
By F2003: "C561 (R528) In an array-element or a scalar-structure-component that
is a data-i-do-object , any subscript shall be an expression whose primaries
are either constants, subobjects of constants, or 
DO variables  of this data-implied-do or the containing data-implied-dos, and
each operation shall be intrinsic."

Now, MODULO is found under 13.5 (Standard generic intrinsic procedures) so, by
my reading of the standard, this is allowed. And the F95 standard seems to have
exactly the same wording.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
           Keywords|                            |accepts-invalid


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
  2006-06-04  9:52 ` [Bug fortran/25095] Disallowed intrinsic in initialization statement fxcoudert at gcc dot gnu dot org
@ 2006-06-04 10:43 ` jv244 at cam dot ac dot uk
  2007-05-21 19:07 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jv244 at cam dot ac dot uk @ 2006-06-04 10:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jv244 at cam dot ac dot uk  2006-06-04 10:42 -------
(In reply to comment #1)
> .. and
> each operation shall be intrinsic

> Now, MODULO is found under 13.5 (Standard generic intrinsic procedures) 

But MODULO is not an intrinsic operation (these are defined in 7.1.2)


-- 


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
  2006-06-04  9:52 ` [Bug fortran/25095] Disallowed intrinsic in initialization statement fxcoudert at gcc dot gnu dot org
  2006-06-04 10:43 ` jv244 at cam dot ac dot uk
@ 2007-05-21 19:07 ` dfranke at gcc dot gnu dot org
  2007-10-07 19:43 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-21 19:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2007-05-21 20:07 -------
Confirmed by majority vote.

$> ifort -warn all pr25095.f90
fortcom: Error: pr25095.f90, line 2: This expression cannot be evaluated.  
[MODULO]
DATA (i(MODULO(j,5)),j=1,4) /4*0/
--------^
fortcom: Info: pr25095.f90, line 1: This variable has not been used.   [I]
INTEGER :: i(10), j
-----------^
compilation aborted for pr25095.f90 (code 1)


$> sunf95 -w4 pr25095.f90

DATA (i(MODULO(j,5)),j=1,4) /4*0/
        ^
"pr25095.f90", Line = 2, Column = 9: ERROR: This function name must not appear
in a DATA statement expression.

f90comp: 3 SOURCE LINES
f90comp: 1 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI


$> gfortran-svn -v
gcc version 4.3.0 20070517 (experimental)

still accepts this code.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-21 20:07:27
               date|                            |


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2007-05-21 19:07 ` dfranke at gcc dot gnu dot org
@ 2007-10-07 19:43 ` tobi at gcc dot gnu dot org
  2007-10-07 19:49 ` tobi at gcc dot gnu dot org
  2008-01-04 11:08 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-10-07 19:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tobi at gcc dot gnu dot org  2007-10-07 19:43 -------
E.g. the following is legal:
   INTEGER :: I(350)
   INTEGER, PARAMETER :: K(500) = (/ i, i=1,500 /)
   REAL :: X
   DATA I(4+K(PRECISION(X))) / 1 /
whereas
   DATA I(PRECISION(X)) / 1 /
isn't.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobi at gcc dot gnu dot org


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2007-10-07 19:43 ` tobi at gcc dot gnu dot org
@ 2007-10-07 19:49 ` tobi at gcc dot gnu dot org
  2008-01-04 11:08 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-10-07 19:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tobi at gcc dot gnu dot org  2007-10-07 19:49 -------
(In reply to comment #4)
> E.g. the following is legal:

iff PRECISION(X) <= 350 :-)


-- 


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


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

* [Bug fortran/25095] Disallowed intrinsic in initialization statement
  2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2007-10-07 19:49 ` tobi at gcc dot gnu dot org
@ 2008-01-04 11:08 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-01-04 11:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2008-01-04 10:10 -------
*** Bug 34664 has been marked as a duplicate of this bug. ***


-- 


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


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

end of thread, other threads:[~2008-01-04 10:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 18:06 [Bug fortran/25095] New: better diagnostic needed jv244 at cam dot ac dot uk
2006-06-04  9:52 ` [Bug fortran/25095] Disallowed intrinsic in initialization statement fxcoudert at gcc dot gnu dot org
2006-06-04 10:43 ` jv244 at cam dot ac dot uk
2007-05-21 19:07 ` dfranke at gcc dot gnu dot org
2007-10-07 19:43 ` tobi at gcc dot gnu dot org
2007-10-07 19:49 ` tobi at gcc dot gnu dot org
2008-01-04 11:08 ` dfranke 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).