Mail Archives: pgcc/1998/08/31/05:16:14
I am not on the mailling list so please reply direct. I have two problems:
1) for some reason pgcc with "certain switches" (-O6 plus one or more of
-mpentium -mcpu=pentiumpro -mstack-align-double -malign-double
-funroll-all-loops ) either dump core, or have a very strange behaviour -
in my program I have a section that does this only has a one-off
initialization:
#define CONTINUE
#define RANDOM_INIT 1
for ijk {
#if (RANDOM_INIT)
m[ijk].x = rand() *2.0 /(RAND_MAX + 1.0) - 1.0;
m[ijk].y = rand() *2.0 /(RAND_MAX + 1.0) - 1.0;
m[ijk].z = rand() *2.0 /(RAND_MAX + 1.0) - 1.0;
#else
m[ijk].x = 0.3;
m[ijk].y = sqrt(0.87);
m[ijk].z = 0.2;
#endif
}
#ifdef CONTINUE
for (i = 0; i < N ; ++i)
{
fscanf(input, "%lg %lg %lg ", &(m[i].x) , &(m[i].y), &(m[i].z) );
}
fclose(input);
#endif
and the compiled code would do the last section of the program code (i.e.
put random numbers into the array m). But after mamnipulation of m else
where, decided to revert to the middle section (putting fixed values into
m), then abort the program. (my program is supposed to read in the m's
from a previous interrupted run, and do some iterations on them and output
the m's once in a while).
2) Somehow I managed to produce a binary with pgcc which behaves in
exactly the same way as the production binary that I compiled with egcs
1.0.3a (-O3 -lm) but faster by about 10%. The iterations already took 5
*weeks* of CPU time so 10 % is a lot, and I would love to be able to know
how I did it. Is there any way of examining the binary to know what
compiler switches I used at the time? I had only been able to produce a
one-off binary that way - I don't seen to be able to reproduce a
pgcc-compiled binary that is even well-behaved (see (1)). During the
entire period , the source code and the input files has not been changed.
Just the compilers pgcc/egcs and the compiler options.
- Raw text -