[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-24 Thread kargl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #17 from kargl at gcc dot gnu.org ---
(In reply to Sarantis Pantazis from comment #15)
>
> It seems it is something trivial but my knowledge outside of fortran is
> still rather limited...
>

Bugzilla is not a Fortran User support forum.  But, to aid in your
suffering.  Remove ALL installed versions of gfortran.  Make sure
that there are no leftover gfortrans or f951 in your path and remove
all old *.mod files.  Now, re-install the latest and greatest version
of gfortran from trunk.


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-24 Thread anlauf at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #16 from Harald Anlauf  ---
(In reply to Sarantis Pantazis from comment #13)
> > Did you update the compiler name in your makefile?
> 
> I have left the line COMPILER=gfortran at the top as it is and I have
> defined an alias in my ~/.bashrc for gfortran pointing to the newly
> installed location (alias gfortran='$HOME/latestGcc/gcc-build/gcc/gfortran').

I think that aliases in a Makefile are a bad idea.  You need to make sure
that the aliases are exported from the invoking shell.

On my system I get:

% alias gfc
alias gfc='gfortran'
% cat Makefile

SHELL = /bin/bash

aliastest:
echo "Running make: alias:"; alias
% make aliastest
echo "Running make: alias:"; alias
Running make: alias:

So no aliases are set!  Try "man bash" and search for "expand_aliases".
I use a symbolic link gfc-trunk (you might prefer gfortran-latest)
to the installed binary and use this in the makefile.


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-24 Thread sarantis.pantazis at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #15 from Sarantis Pantazis  ---
> Did you install the compiler (i.e. run 'make install')?

Yes, I did. I read http://gcc.gnu.org/install/index.html and made a summary of
the steps I followed (attached here). I also kept a log of "make" and "make
install" (also attached here).


I also tried changing COMPILER=gfortran to
COMPILER=/home/sarantis/latestGcc/gcc-build/gcc/gfortran and got the following
error:

gfortran: error trying to exec 'f951': execvp: No such file or directory


> Do you get gzip'ed modules if you use .../gcc/f951 instead of 
> .../gcc/gfortran?

Compiling with COMPILER=/home/sarantis/latestGcc/gcc-build/gcc/f951 leads to
zipped files and no IMPLICIT_PURE. But f951 does not accept -c so no executable
was produced.


It seems it is something trivial but my knowledge outside of fortran is still
rather limited...


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-24 Thread mikael at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

Mikael Morin  changed:

   What|Removed |Added

 CC||mikael at gcc dot gnu.org

--- Comment #14 from Mikael Morin  ---
(In reply to Sarantis Pantazis from comment #13)
> > Did you update the compiler name in your makefile?
> 
> I have left the line COMPILER=gfortran at the top as it is and I have
> defined an alias in my ~/.bashrc for gfortran pointing to the newly
> installed location (alias gfortran='$HOME/latestGcc/gcc-build/gcc/gfortran').
> 
> 
> > cp MOD/generalfunctions.mod generalFunctions.mod.gz
> > gunzip generalFunctions.mod.gz
> 
> I get "gzip: generalFunctions.mod.gz: not in gzip format". But anyway, the
> mod file is readable so I can skip to the third line.
> 
This means you are using an old compiler.
Did you install the compiler (i.e. run 'make install')?
Do you get gzip'ed modules if you use .../gcc/f951 instead of .../gcc/gfortran?


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-24 Thread sarantis.pantazis at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #13 from Sarantis Pantazis  ---
> Did you update the compiler name in your makefile?

I have left the line COMPILER=gfortran at the top as it is and I have defined
an alias in my ~/.bashrc for gfortran pointing to the newly installed location
(alias gfortran='$HOME/latestGcc/gcc-build/gcc/gfortran').


> cp MOD/generalfunctions.mod generalFunctions.mod.gz
> gunzip generalFunctions.mod.gz

I get "gzip: generalFunctions.mod.gz: not in gzip format". But anyway, the mod
file is readable so I can skip to the third line.


> grep PURE generalFunctions.mod

UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN 0 0 SUBROUTINE IMPLICIT_PURE) (
MODULE-PROC DECL UNKNOWN 0 0 FUNCTION IMPLICIT_PURE) (REAL 8 0 0 0 REAL

So, I still get IMPLICIT_PURE. And when I run it I still get the infinite loop
as well, so I guess I missed something during the installation?


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #12 from Dominique d'Humieres  ---
> Yes, I did; I used "make clean" first (also "rm *.o *.f90 *.s" in the main
> folder to clean up the files generated by -save-temps).

Did you update the compiler name in your makefile? I have just been caught by
that when comparing the results in the bug_OPT1mode_withWRITE and
bug_OPT1mode_noWRITE directories. With the right compiler for both, I get

2000105810051017

Can you do the following

cp MOD/generalfunctions.mod generalFunctions.mod.gz
gunzip generalFunctions.mod.gz
grep PURE generalFunctions.mod

you should only see

UNKNOWN-PROC DECL UNKNOWN 0 0 INTRINSIC FUNCTION PURE) () (CHARACTER 1 0
UNKNOWN-PROC DECL UNKNOWN 0 0 INTRINSIC FUNCTION PURE) () (CHARACTER 1 0

i.e., no IMPLICIT_PURE.


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-23 Thread sarantis.pantazis at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #11 from Sarantis Pantazis  ---
Yes, I did; I used "make clean" first (also "rm *.o *.f90 *.s" in the main
folder to clean up the files generated by -save-temps).


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #10 from Dominique d'Humieres  ---
> Thank you for the fast response and effort. I have installed gcc from svn
> but the results are still the same. Perhaps I mis-installed something?
> Attached you will find the logs and the installation workflow.
> Is step #14 perhaps wrong?

Did you recompile the module defining random()?


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-23 Thread sarantis.pantazis at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #9 from Sarantis Pantazis  ---
Thank you for the fast response and effort. I have installed gcc from svn but
the results are still the same. Perhaps I mis-installed something? Attached you
will find the logs and the installation workflow. Is step #14 perhaps wrong?

The output of gfortran -v seems correct though.

Using built-in specs.
COLLECT_GCC=/home/sarantis/latestGcc/gcc-build/gcc/gfortran
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/home/sarantis/latestGcc
--enable-languages=c,fortran,c++ --disable-multilib
Thread model: posix
gcc version 4.9.0 20140323 (experimental) (GCC)


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-23 Thread sarantis.pantazis at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

--- Comment #8 from Sarantis Pantazis  ---
Created attachment 32430
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32430&action=edit
Compilation logs and installation workflow


[Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.

2014-03-20 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60543

Tobias Burnus  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|4.8.3   |4.7.4
Summary|[4.8/4.9 Regression]|[4.7/4.8/4.9 Regression]
   |Function with side effect   |Function with side effect
   |removed by the optimizer.   |removed by the optimizer.

--- Comment #7 from Tobias Burnus  ---
FIXED on the 4.7 and 4.8 branches and on the trunk (to become 4.9.0).

Thanks for the report and sorry for the breakage!