www.digitalmars.com         C & C++   DMDScript  

c++ - Optimizer Bug - bug.cpp

reply John Jameson <John_member pathlink.com> writes:
Hi Walter

Looks like we've finally managed to break DMC 8.45 (100,000's lines of code have
been OK so far!)

Attached is bug.cpp containing:

#include <stdio.h>

int w[16];

void main (void) 
{ char buffer[1024], *ptr=buffer; 
for (int i=0; i<8; ++i) 
ptr += sprintf (ptr, "W%-2d=0x%04X ", i, w[i]); 
printf ("buffer is '%s'\n", buffer); 

Compile as sc -mn bug.cpp and then again with -o+time and get different results.
We haven't looked at exactly, what the compiler is doing.


begin 0644 bug.cpp
M(VEN8VQU9&4 /'-T9&EO+F ^#0H-"FEN="!W6S$V73L-" T*=F]I9"!M86EN
M("AV;VED*0T*('L 8VAA<B!B=69F97);,3`R-%TL("IP='(]8G5F9F5R.PT*
M("` 9F]R("AI;G0 :3TP.R!I/# [("LK:2D-"B` ("` ('!T<B`K/2!S<')I
M;G1F("AP='(L(")7)2TR9#TP>"4P-%  (BP :2P =UMI72D[#0H ("!P<FEN
F=&8 *")B=69F97( :7, )R5S)UQN(BP 8G5F9F5R*3L-"B!]#0H 
Nov 01 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
No prob, I'll take care of it.
Nov 01 2005