On Mon, 23 Apr 2007, Mark Mitchell wrote: > I'm certainly not trying to suggest that we run SPEC on every > architecture, and then make -O2 be the set of optimization options that > happens to do best there, however bizarre.
Why not? Is your objection because SPEC doesn't reflect real-world apps or because the option set might be "bizarre"? The bizarreness of the resulting flag set should not be a consideration IMHO. Humans are bad at predicting how complex systems like this behave. The fact that the "best" flags may be non-intuitive is not surprising. I find the case of picking compiler options for optimizing code very much like choosing which part of your code to hand optimize programmatically. People often guess wrongly where their code spends its time, that's why we have profilers. So I feel we should choose our per-target flags using a tool like Acovea to find what the "best" options are on a per-target basis. Then we could insert those flags into -O2 or "-Om" in each backend. Whether we use SPEC or the testcases included in Acovea or maybe GCC itself as the app to tune for could be argued. And some care would be necessary to ensure that the resulting flags don't completely hose other large classes of apps. But IMHO once you decide to do per-target flags, something like this seems like the natural conclusion. http://www.coyotegulch.com/products/acovea/ --Kaveh -- Kaveh R. Ghazi [EMAIL PROTECTED]