From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,eedbb108d9295ab9 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-10-09 18:22:32 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!darwin.sura.net!rsg1.er.usgs.gov!jobone!fiesta.srl.ford.com!eccdb1.pms.ford.com!charette From: charette@ultoe.det.dec.com (Mark Charette) Newsgroups: comp.sys.dec Subject: OSF/1 3.0 C -O0 bug Date: 8 Oct 1994 16:46:03 GMT Organization: ECC at Ford Motor Company, Dearborn Michigan Message-ID: <376icb$s9e@eccdb1.pms.ford.com> NNTP-Posting-Host: aec590.ve.ford.com X-Newsreader: TIN [version 1.2 PL0] While compiling some code for debugging purposes & setting the optimization level to 0, I discovered the following anomaly, making -O0 useless for my debugging: #include int main(void) { double d; double *dp; unsigned int left = 2; unsigned int order = 3; dp = &d; printf("%p\n",dp; dp += left - order + 1; printf("%p\n",dp); return 0; } Under cc -migrate -O1 the program prints out: 11ffffaa8 11ffffaa8 Under cc -migrate -O0 the program prints out: 11ffffaa8 21ffffaa8 Not exactly what I expected under O0, even if subtracting unsigned ints in that manner is not "good programming practice". --------------------- Mark Charette MIKA Systems 17197 N. Laurel Park Dr. Suite 115 Livonia, MI 48152