This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++.old-deja/g++.mike/p7325.C - suspected bogus test case
Hi Mark,
On Mon, 12 Jul 2004, Mark Mitchell wrote:
> > 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.
black-box in the sort of testing in a way for which no guarantee is given
by the language standard? Well, then call it testing of implementation
defined behaviour (and we define it to reuse stack slots under well
defined circumstances; as first iteration circumstance == {compiled with
not -O0}). This testcase is testing a specific behaviour of
the implementation, and I think it does so reliably (if it would work ;-)
). Namely that the this pointer doesn't change (by extension this means
that stack slots were reused for this class, i.e. what we wanted).
I don't regard this as a strictly black box. Yes, ideally we would like
to have unit tests, which really look at the stack layout to prove what we
wanted to prove more directly. But we don't have, and as Mike said, it's
the only test-case remotely testing for the wanted behaviour. I think
this justifies that it should stay, until we have said unit tests ;-)
> 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.
Ciao,
Michael.