[comp.os.msdos.programmer] MSC5.1 - program fails when optimised ?

G.Eustace@massey.ac.nz (Glen Eustace) (12/17/90)

I am presently devloping some programs using the Programmer's Toolkit
that is available as an add-on to the Sun Microsystems PC-NFS
product.  I am getting thoroughly frustrated by the following
situation which I hope some one can help with.  If I compile all the
modules ( MSC 5.1 ) with the options,

 CFLAGS        = -c -Zi -Od -AL -G0 -D$(MSC) $(INCLUDE)

then the program generally works.  But when I attempt to use

 CFLAGS        = -c -Gs -Ox -AL -G0 -D$(MSC) $(INCLUDE)

all various parts fail completely.

I have had this experience with other operating systems and compilers
but am not really sure what I ought to be looking for with MSC to fix the
problem.  If it is to do with the optimisation can anyone suggest
what constructs could be being corrupted.  If I change the level of
optimisation what is a good alternative.  If its not optimisation at
all can some one throw some light on the situation.

Any help appreciated, Thanks.



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Glen Eustace, Software Manager, Computer Centre, Massey University,
Palmerston North, New Zealand.        EMail: G.Eustace@massey.ac.nz
Phone: +64 63 69099 x7440, Fax: +64 63 505 607,    Timezone: GMT-12

risto@tuura.UUCP (Risto Lankinen) (12/27/90)

G.Eustace@massey.ac.nz (Glen Eustace) writes:

> ... If I compile all the
>modules ( MSC 5.1 ) with the options,

> CFLAGS        = -c -Zi -Od -AL -G0 -D$(MSC) $(INCLUDE)

>then the program generally works.  But when I attempt to use

> CFLAGS        = -c -Gs -Ox -AL -G0 -D$(MSC) $(INCLUDE)

>all various parts fail completely.

Hi!

I have experienced similar problems in the Windows environment.  I got the
problem nailed into the use of -Oe switch, which (according to documentation)
enables the global register allocation.  It could also have been an 'unsafe'
optimization for Windows, only.  Anyway, my code now works after exclusion of
the -Oe switch (which incidentally is 'included' in the -Ox switch).

In place of -Ox switch for Windows programs, I'm using...

      CL -c -AS -G2csw -Ocgilswz -Zcelp FILENAME.C

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************