Microsoft C 5.1 - bug

Anthony Scian afscian at violet.waterloo.edu
Sat Apr 15 04:11:38 AEST 1989


In article <3758 at uhccux.uhcc.hawaii.edu> wilson at uhccux.UUCP (Tom Wilson) writes:
>In article <1051 at dgbt.uucp> lew at dgbt.crc.dnd.ca (Lew Stelmach) writes:
>>The following program compiles successfully on Microsoft C5.1,
>>Microsoft Quick C 2.0, TurboC, DEC VAX Ultrix C, Sun Unix C, and other
>>compilers.  However, it does not run correctly when compiled using
>>Microsoft C5.1. Note that it runs correctly on Microsoft Quick C 2.0.
>[ Program listing and output deleted]
>1.  I ran this and confirm the bug in MSC 5.1
>2.  When I specified no compiler optimzation (/Od), the bug went away.  While
>    I don't have time to look at the object output, it looks like maybe some
>    incorrect overoptimization.
The problem is probably in the -Oa (ignore aliasing) optimization.
The 'ignore aliasing' optimzation will assume that any indirection
will not invalidate any other value that may be stored in registers
or temporaries. The 'ignore aliasing' optimization is a dangerous 
optimization to perform especially in the 'anything goes' form 
that Microsoft uses. (Turbo C has the same problem in certain cases)
Basically, -Ox is unusable because -Ox turns on this optimization.
The 'loop optimzations' switch -Ol is also dangerous because it can 
break working programs (although at a lesser rate).

//// Anthony Scian afscian at violet.uwaterloo.ca afscian at violet.waterloo.edu ////
"I can't believe the news today, I can't close my eyes and make it go away" -U2



More information about the Comp.lang.c mailing list