Path: utzoo!attcan!uunet!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft C 6.0 BAD code generation Message-ID: <3785@optilink.UUCP> Date: 14 Jun 90 18:25:07 GMT References: Organization: Optilink Corporation, Petaluma, CA Lines: 27 In article , mshiels@tmsoft.uucp (Michael A. Shiels) writes: > One of my co workers was trying to start using Microsoft C 6.0 but found out > that it's just like Microsfot C 5.1. You have to disable most of the > optimizations so it will generate correct code. Here's his very simple sample > code which doesn't have anything to do with loops but is broken when you specify > loop optimizations. I have had a similar problem, specifying the following flags: cl -Zi -AL -Gt16 -I../INCLUDE/ -c The code that I tried to compile was: RetCode = (*LFunctions[(int) *pLActions])(); pLActions++; Unless I specify -Od to disable all optimizations, pLActions is incremented BEFORE the indirection is performed. I no longer worry about benchmark comparisons of the Microsoft C compiler -- my experience is that -Od is necessary not only for debugging, but for execution as well. -- Clayton E. Cramer {pyramid,pixar,tekbspa}!optilink!cramer Pipe bomb: appropriate technology for living lightly on Mother Earth. :-) ---------------------------------------------------------------------------- Disclaimer? You must be kidding! No company would hold opinions like mine!