From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079091516399.tru64-unix-managers.marc@archive.invalid> From: Joerg Bruehe Date: Thu, 16 Dec 1999 13:51:39 +0000 To: tru64-unix-managers Subject: SUMMARY: Compiler differences 4.0B - 4.0D ? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079091516399 Dear managers ! This is the summary I owe to you, even though it has very little contents. Originally I had asked: > > Last week I upgraded our 2100A from 4.0B to 4.0D > ("better late than never") using the standard upgrade. > > Just to be sure, I then recompiled and relinked our software - > and several tests I then ran failed, generating core dumps ! > ((...)) > > However, I checked that the '-O'-options given had been unchanged > (for my test program, mostly '-O1' and some '-O2'), that also > applies to '-std1' (is used) and the relevant '-D...' options. > > The symptoms of the crash are such that I suspect wrong optimisation, > but I can not (yet) tell for sure. ((...)) I got one answer only: mailed > We had problems moving from 4.0b to 4.0d, the main issue was the > cc default mode changed to anci compliant instead of k&r. The > make file -stdx switch fixed most of the programs that core > dumped on us. However, as I called 'cc' with '-std1' both before and after the upgrade, this seems not to be my problem. Using a "trial and error" approach, I am now stepping through the list of modules to isolate those whose compilation with '-O1' causes the program to fail whereas '-O0' works correctly. By now, I have identified some ten (of 328) modules for which this applies, but unluckily I can not tell the similarities causing this compiler problem. Judging by the erroneous effects (some cause core dumps, others just make the program produce wrong results) I assume that in some circumstances '-O1' makes the compiler reorder instructions in such a way that data accesses are moved across function calls out of critical (protected) regions. This problem may be caused by the lack of prototype information or protective pragmas (our C code is tool-generated), but all this is (until now) unproven guesswork. Regards and a Merry Christmas to all of you ! Joerg Bruehe -- Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany (speaking only for himself) mailto: joerg@sql.de