Using Optimization flag in Fortran

Vardhan, Sundara (GE Infra, Energy) sundara.vardhan@ge.com
Tue Dec 1 13:25:00 GMT 2009


Hi All

Recently I added the -O3 flag to compile gfortran code. The application
uses OPEN() call to open files. These calls are made in a sequence, one
after another to open about 4 files before any operation on any of these
files are performed. This code works fine when compiled with no
Optimization flags. However upon adding the Optimization flags (be it -O
or -O3), the first OPEN() works fine and the next OPEN() call fails. I
suspect that the optimization flag turns on some check which may be
causing this failure. I would very much appreciate your help and advice
on what may be the reason for such a behaviour.

Thanks in advance

With Regards

Vardhan



More information about the Gcc-help mailing list