Newsgroups: comp.os.msdos.programmer
Path: utzoo!utgpu!watserv1!maytag!cgeisler
From: cgeisler@maytag.waterloo.edu (Craig Eisler)
Subject: Re: Optimization (was: Re: TC++ Bug)
Message-ID: <1990Jul25.203325.15173@maytag.waterloo.edu>
Organization: University of Waterloo
References: <2587@mindlink.UUCP>
Date: Wed, 25 Jul 90 20:33:25 GMT
Lines: 28

In article <2587@mindlink.UUCP> a269@mindlink.UUCP (Mischa Sandberg) writes:
>It's a pretty wretched development philosophy if MS has to
>document IN THE MANUALS that optimization will barf at
>trivial cases like
>        for ( i = 0; i < limit; i++ )
>                if ( x != 0 )
>                        a[i] = 1/x
>for x == 0 ( admittedly bozo code, but ...)

This only happens with the so-called agressive optimizations on; what 
the compiler does then is make brain-dead assumptions about loop-invarient code
(along with other things).  They give you the option of using
these optimizations if you haven't done things like that in your code.

Of course, when developing anything of substance, you can never be sure.
So leave "aggressive" optimizations filed under "stupid things microsoft
has done".  In my opinion, microsoft did this because it helped them
get better numbers on certain benchmarks.

On the other hand, their normal optimizations are fine.  You are mis-represent
what they are doing; what is this "outrageous abuse by compiler developers"?
They have simply said, with this switch on, we will relax a number of 
assumptions we normally make.  No one is abusing you.

craig
-- 
Craig Eisler, still hiding from the real world.
University of Waterloo, Waterloo, Ontario.
