From: Dan Sugalski Date: 2003-01-07T01:11:03+09:00 Subject: Re: Compile time constant folding? At 4:14 PM +0900 1/6/03, Dalibor Sramek wrote: >On Mon, Jan 06, 2003 at 11:15:46AM +0900, Dan Sugalski wrote: >> You'd be surprised, especially when you factor in some other >> optimizations--you can do some substitutions and inferences of >> variable contents. > >Could the programmer help the compiler with guessing when the >optimization is feasible? Generally not--it seems to hurt more than it helps in places where you can do it. Most people get that sort of thing wrong, and when they do get it right those sorts of hints get stale quickly. It's better to just clearly express the semantics and let the compilers take care of figuring out where things can be feasably optimized. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk