XLF optimizer unreliable, inappropriate for benchmarks

Applied Magnetics 3003jalp at ucsbuxa.ucsb.edu
Fri Sep 21 09:04:12 AEST 1990


In article <384 at nwnexus.WA.COM> golder at nwnexus.WA.COM (Warren Jones) writes:

> [ gives a short Fortran program that optimizes incorrectly ]
>Incidentally -- does anyone know if all the XL languages (including
>C and Pascal) use the same optimizer?  Until I'm sure of the
>answer, I'm not using the C optimizer either.

Well, I transliterated your example to C and got the same behaviour.
Congratulations to your programmer for producing such a small example.

#include <stdio.h>

main()
{
    int b, i, k, m, n; 
    int test;

    test= 1;
    i= k= m= 0;

    do {
        i++;
        if(test) {
            for(n= 0; n<3; n++) {
              m++;
              k++;
              b= k+1;
            }
            printf("k= %d,  k-1= %d\n", k, k-1);
        }
    } while(i<2);
}

-- P. Asselin, Applied Magnetics Corp.



More information about the Comp.unix.aix mailing list