[Bug libfortran/23889] non intuitive behaviour of gfortran

kamaraju at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 15 02:12:00 GMT 2005


------- Additional Comments From kamaraju at gmail dot com  2005-09-15 02:11 -------
Subject: Re:  non intuitive behaviour of gfortran

On 15 Sep 2005 00:15:27 -0000, kargl at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> 
> ------- Additional Comments From kargl at gcc dot gnu dot org  2005-09-15 00:15 -------
> (In reply to comment #0)
> > consider the following program
> > program random
> > implicit none
> >  real :: x
> >  call random_seed();
> >  call random_number(x);
> >  write(*,*) x
> > end program random
> >
> > When I run this program, I want to output different random numbers for
> > each run. This does not happen with gfortran.
> >
> 
> > I agree that the current gfortran's behaviour is standard conforming.
> 
> Enough said.
> 
> > But it is counter intuitive.
> 
> It is counter intuitive to you not me.
> 

Dont know what to say. Well if the original authors want it that way
there is really nothing I can do about it.

Would it atleast be possible to implement it as an extension?
Something like if the user gives an option in the compiling command,
then the random numbers generated across different runs will be
different.

> > Absoft 8.0 exhibits this behaviour
> >
> > % f90 random.f90
> > % ./a.out
> >    0.139087
> > % ./a.out
> >    0.139087
> > % ./a.out
> >    0.139087
> > % ./a.out
> >    0.139087
> >
> >
> > So absoft, intel, g95 compilers generate different sequences on
> > subsequent runs.
> 
> What is Absoft's behavior?  It appears to agree with gfortran.

Sorry that was my bad. Absoft's and gfortran's behaviour are indeed
the same. But g95 and intel's behaviour are different than gfortran
(in this issue).


-- 


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



More information about the Gcc-bugs mailing list