Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!spdcc!esegue!compilers-sender From: pardo@cs.washington.edu (David Keppel) Newsgroups: comp.compilers Subject: Unsafe Optimizations (WAS: Compiler Design in C How about it?) Keywords: books, optimize Message-ID: <1990Jun4.044255.14857@esegue.segue.boston.ma.us> Date: 4 Jun 90 04:42:55 GMT References: <1990Jun1.194941.5781@esegue.segue.boston.ma.us> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: pardo@cs.washington.edu (David Keppel) Organization: University of Washington, Computer Science, Seattle Lines: 42 Approved: compilers@esegue.segue.boston.ma.us Preston Briggs writes: >[Summary of A. Holub's ``Compiler Design in C''.] >[``It's better to provide maximum optimization even if dangerous.''] >[Outrageous!] I agree wholeheartedly. I've been taking a class this quarter and we've been studying optimizaing compilers for supercomputers, e.g., the vector machines, the SIMD machines, and the shared-memory multiprocessors. Today in class, I expressed the following opinion: ``You compile your program 100 times with optimization turned off and then 1 time with optimization turned on. It's no wonder that so many bugs show up in the optimizer, it hardly ever gets tested. Therefore, you should compile your programs with only the optimizations that you can ``debug through'' and leave it at that.'' An extreme position, I know, I was actually trying to be provocative rather than express my own opinion. Anyway, at this point one of my classmates -- who has worked on optimizing compilers for several high-performance computers -- tells me that I am free to feel that way, but that her customers won't buy my product. They'd rather spend time figuring out why their code gives wrong answers than spend time waiting for their computer to give the right answer. (Ok, so they run programs that take a week to execute...) It's not quite the same thing as ``provide optimizations even if dangerous'', but I'd just finished listening to a 10-minute report from a group that had spent most of their time trying to figure out why the compiler for a vectorizing multiprocessor kept producing incorrect code. Flame away... ;-D on ( Debugger they come, deharder they foul ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.