jon@ccwf.cc.utexas.edu (Jon Boede) (12/08/90)
Hopefully I'm posting old news... but I found a rather insidious bug in cc version 1.6. It seems that if you use the -Oa "ignore aliasing" option with the -Ol "enable loop optimizations" option, it starts thinking deciding that more things are loop invariants than really are! The seductively named -Ox "max. optimization" option implies -Oal. Try: cc x.c; a.out; cc -Ox x.c; a.out; cc -Oal x.c; a.out ----- cut here -- x.c main() { int value; value = 1; printf("1. value is %d\n",value); do { printf("2. value is %d\n",value); puts(value ? "works ok" : "your compiler is broke"); value = 0; } while (false()); } false() { return(0); } ----- ereh tuc It's a little bothersome to turn on "max. optimization" and have your code stop working! ;-) Jon -- Jon Boede jon@bodedo.ucm.org ...!{the-world}!uunet!cs.utexas.edu!bodedo!jon 7117 Wood Hollow #1013, People's Republic of Austin, TX 78731 +1 512 346-3142