Re: code speed moving from fortran 77 compiler to f2003 compiler



e p chandler <epc8@xxxxxxxx> wrote:
(snip)

Is there some practical way to run individual routines though a
checkout compiler so that you can at least find those variables that
are NOT initialized?

IIRC Watfor had this capability. I don't know about Open Watcom.

I once ran a few thousand line program through WATFIV to find
uninitialized variables. Compared to Fortran H it compiled about
ten times faster, and ran about ten times slower.

I realize that this is a monumental task, but it's sort of like the
national debt. It just keeps getting bigger, it's too large to fail,
and eventually it will have to be dealt with.

It would be a nice feature to have in at least one compiler.
Another possibility would be a source to source translator
that would take Fortran source as input and generate Fortran
source with the appropriate checks as output. In this case,
it would have to initialize all variables to some rare value,
and then IF statements before every access to check for that
value. Not easy, but not so hard, either.

-- glen
.



Relevant Pages

  • Re: code speed moving from fortran 77 compiler to f2003 compiler
    ... ten times faster, and ran about ten times slower. ... that would take Fortran source as input and generate Fortran ... it would have to initialize all variables to some rare value, ... I've suggested to Lynn in the OW forum the investment in another compiler that has such facilities would likely pay a significant ROI. ...
    (comp.lang.fortran)
  • Re: abstract sub programs overriding
    ... >>compiler can determine that Object is never referenced before it is ... >>implicit Finalize. ... >>the Initialize is user defined. ... > if that initial value is an aggregate, it has to be built directly in the ...
    (comp.lang.ada)
  • Re: compiler bugs
    ... In a language like C, the behavior of programs that reference ... Not if the unoptimizing compiler initializes all variables to some ... portion of the array in your algorithhm. ... that one actually does not need to initialize all variables (unlike ...
    (comp.compilers)
  • Re: Javac issues "might be uninitialized" for null test
    ... And any compiler worth its salt would ... Java does not initialize variables (as opposed to class ... Some languages "initialize with garbage" and allow ... compare the non-existent value to `null' is erroneous. ...
    (comp.lang.java.programmer)
  • Re: Replicating results
    ... gradient calculation used in a large optimization routine. ... It will make sure that if you do something like declare a variable called "x1" and use a variable called "xl" the compiler will tell you that xl was undeclared. ... Make sure that you initialize all of your variables, ...
    (comp.lang.fortran)