Re: C4GL doesn't use optimization?
Posted in 1994
>From: jsturm@garnet.msen.com (Jeffrey Sturm) >Subject: C4GL doesn't use optimization? >Date: 16 Sep 1994 04:03:43 GMT >X-Informix-List-Id: <news.8776> >We are installing c4gl at a site where all development has previously >been done in RDS. I was a little suprised to read the c4gl script and >find that it calls the "rcc" compiler without any optimizer flags, >particularly "-O". (The development system has SCO 3.2.?) >I decided to experiment a little and slip in the -O compiler option. >After recompiling, some programs were 100K-200K smaller. There may also >be a speed improvement, although it is probably negligible. >Does anybody know a reason the optimizer phase should not be used? I >know from examination of some generated C code that Informix creates >dead code often, probably because it has no real optimization of >its own, so it seems that it could benefit a lot from the C optimizer. If you want the code optimized, you can say so. The c4gl script does not enforce it. One reason is that many (depressingly many) optimizers are broken and generate duff code -- as in core dump. Also, you, the programmer, should be able to choose. With 4.12 or 6.00, you can use the C4GLFLAGS environment variable to set -O automatically for all compilations, including those from the I4GL programmer's environment. >On a similar vein, why not link to the shared C library, using -lc_s? >It shrinks my executables further by about 16KB. I've tested several >programs this way with no apparent ill effects. This may be a little trickier to fix automatically, but there is no reason why you can't include it on your command lines. Of course, truly civilized ooperating systems provide shared libraries as the default (or by using a standard compiler option such as -Bdynamic in SVR4), not by specifying a new library name. Clearly, neither SCO nor Interactive (which is where I've come across -lc_s) is truly civilized. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>