From: kagel AT quasar DOT bloomberg DOT com Date: Wed, 27 Nov 1996 14:46:29 -0500 Message-Id: <9611271946.AA11268@quasar.bloomberg.com > To: gminer AT Newbridge DOT COM Cc: djgpp AT delorie DOT com In-Reply-To: (message from Glen Miner on Wed, 27 Nov 1996 14:36:02 -0500 (EST)) Subject: Re: Optimization Reply-To: kagel AT dg1 DOT bloomberg DOT com Errors-To: postmaster AT ns1 Date: Wed, 27 Nov 1996 14:36:02 -0500 (EST) From: Glen Miner X-Sender: gminer AT coop10 Cc: djgpp AT delorie DOT com Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Length: 866 > Clearly -O3 optimizations using array indexing and optimizer determined > register allocation is the fastest scheme. This shows several points: > > 1) Using array indexing is superior to using pointers when any level of > optimization is used. > 2) Manual register allocation is only helpful if no optimization or -O > optimization is used! > 3) Manual register allocation is most helpful with variables used in the > array indexing than pointers. Umm, just a suggestion: this information _REALLY_ should find it's way into the faq. I did do a quick check for this kind of info and didn't come up with anything. Gee, I though that everyone knew that GCC has the best optimizer available [and I used to swear by Datalight C (now Semantec C/C++)]. But seriously .... Most modern optimizers do a better job than we can on mainline stuff like array referencing. Depending on the particular optimizer and machine structure the results can be dramatic, especially on pipelined architectures where the optimizer knows how to reschedule register loads etc and in "C" we cannot do that. BTW: I'd say that the GCC optimizer will even do a better job than hand coded asm in most cases and close enough that it isn't worth the effort almost all the time! -- Art S. Kagel, kagel AT quasar DOT bloomberg DOT com A proverb is no proverb to you 'till life has illustrated it. -- John Keats