Paul Edwards wrote: > One of the things that I experienced when porting 3.2.3 to MVS > was that GCC was sensitive to the exact floating point representation. > > Register selection was different depending on those slight differences. > > Below is what documentation I have for it. Dave Edwards, who > wrote another S/370 emulator, was the one who discovered that. > > Does anyone know if that was changed somewhere along the line? > > BFN. Paul. > > > > 17. The assembler code generated by gccmvs when run on the > PC is slightly different (even when the same parameters > are used for code generation) from that when run on the > mainframe, if -O2 is used instead of -Os. But functionally > equivalent. This non-deterministic nature of the compiler > is disconcerting. It seems to not always allocate registers > consistently. This has been traced to floating point code > in predict.c and local-alloc.c which is sensitive to the > very small changes in floating point representation. This > should be changed to include deltas when comparing floating > point values. Here's an example of what's happening:
I agree that GCC output should not depend on details of the host floating point representation. (Ideally, the output of GCC built as a cross-compiler should not depend on the host architecture at all.) However, it is hard to say whether such observations made on a GCC 3.2 code base have any relevance to the current code -- for example, local-alloc.c does not even exist any more, we now have a completely new register allocator. I'd recommend you go ahead with a port to current mainline and verify whether you still see problems along those lines; if so, it would be appropriate to open a bug report against GCC. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE ulrich.weig...@de.ibm.com