public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37961]  New: [F2003] random_seed - allow integer(8) for the arguments
@ 2008-10-30 20:05 burnus at gcc dot gnu dot org
  2008-10-30 20:22 ` [Bug fortran/37961] " kargl at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-10-30 20:05 UTC (permalink / raw)
  To: gcc-bugs

Fortran 2003 allows all kinds for arguments (-> please re-check).

For i8 the library already contains: random_seed_i8. How to handle i16?

Note: One still needs to support calls with different integer types, esp. if
one needs to modify the variable (-> convert back). [Unless there can be only
one argument at a time.]

Additionally, the front end currently rejects i8:

Error: 'size' argument of 'random_seed' intrinsic at (1) must be of kind 4     
               1
Error: 'put' argument of 'random_seed' intrinsic at (1) must be of kind 4


-- 
           Summary: [F2003] random_seed - allow integer(8) for the arguments
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/37961] [F2003] random_seed - allow integer(8) for the arguments
  2008-10-30 20:05 [Bug fortran/37961] New: [F2003] random_seed - allow integer(8) for the arguments burnus at gcc dot gnu dot org
@ 2008-10-30 20:22 ` kargl at gcc dot gnu dot org
  2008-10-31  1:05 ` sgk at troutmask dot apl dot washington dot edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-10-30 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2008-10-30 20:20 -------
(In reply to comment #0)
> Fortran 2003 allows all kinds for arguments (-> please re-check).

Not according to my draft of F2003.

   SIZE (optional) shall be scalar and of type default integer. It is an
   INTENT (OUT) argument.  It is assigned the number N of integers that
   the processor uses to hold the value of the seed.

> For i8 the library already contains: random_seed_i8. How to handle i16?
> 
> Note: One still needs to support calls with different integer types, esp. if
> one needs to modify the variable (-> convert back). [Unless there can be only
> one argument at a time.]

According th F2003 standard:

Arguments. There shall either be exactly one or no arguments present.

> Additionally, the front end currently rejects i8:
> 
> Error: 'size' argument of 'random_seed' intrinsic at (1) must be of kind 4     
>                1
> Error: 'put' argument of 'random_seed' intrinsic at (1) must be of kind 4

This is the correct behavior.


-- 


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


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

* [Bug fortran/37961] [F2003] random_seed - allow integer(8) for the arguments
  2008-10-30 20:05 [Bug fortran/37961] New: [F2003] random_seed - allow integer(8) for the arguments burnus at gcc dot gnu dot org
  2008-10-30 20:22 ` [Bug fortran/37961] " kargl at gcc dot gnu dot org
@ 2008-10-31  1:05 ` sgk at troutmask dot apl dot washington dot edu
  2008-10-31  6:45 ` burnus at gcc dot gnu dot org
  2008-10-31  6:59 ` sgk at troutmask dot apl dot washington dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2008-10-31  1:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from sgk at troutmask dot apl dot washington dot edu  2008-10-31 01:02 -------
Subject: Re:  [F2003] random_seed - allow integer(8) for the arguments

I just checked the F2008 draft for the next standard.  It says

13.7.95   RANDOM SEED ([SIZE, PUT, GET])

      Description. Restarts or queries the pseudorandom number generator
      used by RANDOM_NUMBER.

      Class. Subroutine.

      Arguments. There shall either be exactly one or no arguments present.

      SIZE (optional)  shall be scalar and of type default integer.  It
           is an INTENT (OUT) argument.  It is assigned the number N of
           integers that the processor uses to hold the value of the seed.

      PUT (optional)   shall be a default integer array of rank one and
           size  N . It is an INTENT (IN) argument. It is used in a
           processor-dependent manner to compute the seed value accessed
           by the pseudorandom number generator.

      GET (optional)   shall be a default integer array of rank one and
           size  N It is an INTENT (OUT) argument. It is assigned the
           current value of the seed.

I think this PR should be closed with a WONTFIX.


-- 


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


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

* [Bug fortran/37961] [F2003] random_seed - allow integer(8) for the arguments
  2008-10-30 20:05 [Bug fortran/37961] New: [F2003] random_seed - allow integer(8) for the arguments burnus at gcc dot gnu dot org
  2008-10-30 20:22 ` [Bug fortran/37961] " kargl at gcc dot gnu dot org
  2008-10-31  1:05 ` sgk at troutmask dot apl dot washington dot edu
@ 2008-10-31  6:45 ` burnus at gcc dot gnu dot org
  2008-10-31  6:59 ` sgk at troutmask dot apl dot washington dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-10-31  6:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-10-31 06:44 -------
INVALID - only default integers are allowed


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug fortran/37961] [F2003] random_seed - allow integer(8) for the arguments
  2008-10-30 20:05 [Bug fortran/37961] New: [F2003] random_seed - allow integer(8) for the arguments burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-10-31  6:45 ` burnus at gcc dot gnu dot org
@ 2008-10-31  6:59 ` sgk at troutmask dot apl dot washington dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2008-10-31  6:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from sgk at troutmask dot apl dot washington dot edu  2008-10-31 06:57 -------
Subject: Re:  [F2003] random_seed - allow integer(8) for the arguments

On Fri, Oct 31, 2008 at 06:44:07AM -0000, burnus at gcc dot gnu dot org wrote:
> 
> INVALID - only default integers are allowed
> 

Tobias, thanks.

In reviewing my previous post, the post may have appeared
confrontational.  That was completely unintention.  I was
just trying to convey what the various standards say.


-- 


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


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

end of thread, other threads:[~2008-10-31  6:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 20:05 [Bug fortran/37961] New: [F2003] random_seed - allow integer(8) for the arguments burnus at gcc dot gnu dot org
2008-10-30 20:22 ` [Bug fortran/37961] " kargl at gcc dot gnu dot org
2008-10-31  1:05 ` sgk at troutmask dot apl dot washington dot edu
2008-10-31  6:45 ` burnus at gcc dot gnu dot org
2008-10-31  6:59 ` sgk at troutmask dot apl dot washington dot edu

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).