But I cannot tell who is at fault!. I built regina 3.0 with gcc
3.1 on 2 different linux mandrake systems, both exhibit the
fault. In get_a_strendTSD() in memory.c, we have (line 783)
mt->flists[bin] = (*((char **)(vptr))) ;
((streng *)vptr)->len = 0 ;
the compiled code or 2nd line actually zeros the
mt->flists[bin] pointer to chain of unused blocks, not the len
field of the new block.
Consequently, almost 8k of available mem is discared on
every call to get_a_strengTSD. rexxcps.rexx consumes
This only happens with gcc 3.1, 3.0x and 2.9x are fine, and
only with -O2 or -O3 - -O1 is ok.
Looking thru the gcc-bugs mailing list archive, I found bug
6752, which implies a possible coding error (we are using
char * and streng * types to point to the same location), and
that in such cases we should use gcc option -fno-strict-
aliasing Sure enough this fixes the problem so I would like
to suggest we add this to configure.in for gcc when using -
O3. The alternative would be to find a cast that would keep
the optimiser happy - I havnt found one (so it might still be a
compiler bug) the -fno-strict-aliasing option has no
measurable effect on the performance of regina.