This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++.old-deja/g++.mike/p7325.C - suspected bogus test case

Michael Matz wrote:


On Sun, 11 Jul 2004, Mark Mitchell wrote:

Mike Stump wrote:

On Wednesday, June 30, 2004, at 10:03 AM, Mark Mitchell wrote:

Yes. And without optimization enabled, I don't see any reason that the
compiler should be expected to reuse the stack space; that's an
optimization. The compiler might, for example, be able to generate code
more quickly by using a new stack slot for every variable. Or, using
different stack slots, might result in faster code on some machines, which
is nice even at -O0.

If people find no other way to make it work other than -Os, that's fine.

I think -Os is an optimization for code size, not for stack size. It's not
clear to me that reusing the stack slot will result in smaller code all the
time on all machines.

The probability for this is quite small. If such machine happens to exist the testcase can be XFAILed for it. Equally unlikely are machines for which not merging stack slots produces faster code, be it for smaller stack frame, hence possibly shorter insn encoding, not to mention cache effects. Why do you use such constructed examples?

I'm uncomfortable with using this kind of black-box approach for testing optimization capabilities.

If we're trying to test that some program runs quickly, we should run it, time it, and track that over time. If we're trying to test that some optimization pass performs a particular transformation, we should have a way of doing a unit test, rather than pushing source code through.

Of course, if the consensus here is that the test is useful, then we should put it back -- but with an XFAIL marker since it doesn't work at the moment.

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]