This is the mail archive of the gcc@gcc.gnu.org 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


Mike Stump <mrs@apple.com> 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
meaningful.  

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?

zw


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