This is the mail archive of the
mailing list for the GCC project.
Re: g++.old-deja/g++.mike/p7325.C - suspected bogus test case
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Mike Stump <mrs at apple dot com>
- Cc: gcc at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 26 Jun 2004 11:09:12 -0700
- Subject: Re: g++.old-deja/g++.mike/p7325.C - suspected bogus test case
- References: <13588461-C746-11D8-9F4A-003065BDF310@apple.com>
Mike Stump <firstname.lastname@example.org> writes:
> We want to ensure short life times of things that have short lifetimes
> and that we reuse the space quickly. This is not an unreasonable
> thing to test or expect and it is important to test for such things.
> I don't know of an easy or better way to test for this. I suppose
> that a statistical approach might be better, essentially take the
> address of an automatic and just have many, many large objects and
> then check to see how we are doing on space.
Okay, so it is trying to test what I thought it was trying to test.
> I believe it used to work and pass, and someone broke it and didn't
> fix it.
It has been XFAILed since the creation of the EGCS CVS repository,
except for a short window in late 1997-early 1998.
> You want to get rid of a test case that found a regression instead of
> enticing someone to fix the compiler?
No, I want to get rid of a test case that fails to test anything
Let me reiterate that: it does not test anything meaningful. It
currently passes or fails depending on details of the platform ABI.
Worse, the compiler is within its rights to extend the lifetimes of
the temporaries because it notices that their addresses have been
taken. In fact, I expect Ken Zadeck's better alias analysis will
have that effect.
The only way to test this reliably would be to add a debugging switch
that printed out the layout of each stack frame. I would support
that, and I would support a good thorough set of unit tests for stack
layout. I certainly do want to see better stack layout; would you
like to dust off Naveen Sharma's stack-frame optimizer?