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.

Cheers
John


begin 0644 bug.cpp

M("AV;VED*0T*('L 8VAA<B!B=69F97);,3`R-%TL("IP='(]8G5F9F5R.PT*

M;G1F("AP='(L(")7)2TR9#TP

`
end
Nov 01 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
No prob, I'll take care of it.
Nov 01 2005