wrong code with -fforce-addr
Manfred Schwarb
manfred99@gmx.ch
Wed Aug 29 10:04:00 GMT 2007
Hi,
I have a rather nasty wrong code issue with recent gfortran (of yesterday) at higher optimisation levels.
It's in a large program with a lot of legacy things in it, mixed c and fortran (66-95).
I could track down the error to one subroutine with 300 LOC of fortran95 (well, fortran66 with
some few fortran95 statements).
With "-O2 -fforce-addr", the program produces the correct output,
with "-O2 -march=pentium4 -fforce-addr" the output is wrong.
If I omit "-fforce-addr", the output is always correct.
At optimisation level "-O1", i.e. "-O1 -march=pentium4 -fforce-addr", the output is OK.
The output of -fdump-tree-optimized is the same for the working and non-working case.
As expected, there are differences in the assembler output, however, I do
not speak assembler.
As this program has a lot of iterations and a lot of data IO, it seems rather unrealistic
to poke with a debugger or putting in print statements.
Has anybody an idea how to narrow things?
What would be the appropriate debug output to see what is going wrong?
Thanks,
Manfred
More information about the Fortran
mailing list