This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16269] New: g++ doesn't reuse stack space
- From: "mrs at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2004 14:42:17 -0000
- Subject: [Bug c++/16269] New: g++ doesn't reuse stack space
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There used to be a test case in dejagnu that tested for g++'s ability to reuse stack space. That
testcase was g++.old-deja/g++.mike/p7325.C:
// { dg-do run { xfail *-*-* } }
// I hate this type of test case. I'm not sure how to code it better.
// See the PR for what this tests.
// prms-id: 7325
int fail = 0;
struct A {
int i;
static const A* match_this;
static const A* match_arg;
A(): i(7) {
if (match_this)
if (match_this != this)
fail = 1;
}
A* get_this() { return this; }
A& operator = (const A& o) {
if (match_this)
if (match_this != this)
fail = 1;
if (match_arg)
if (match_arg != &o)
fail = 1;
match_arg = &o;
return *this;
}
};
const A* A::match_this;
const A* A::match_arg;
A a;
A foo() { return a; }
void f ()
{
A a;
A::match_this = &a;
a = foo ();
a = foo ();
A::match_this = 0;
}
void g ()
{
A::match_this = A().get_this();
A();
A();
A::match_this = 0;
}
int main() {
f();
g();
return fail;
}
This used to pass, but someone broke it. Redhat's devo should be able to tell us when it passed
by checking the add time of the testcase. A search should tell us who broke it and when.
More state can be found in 7325 in Redhat's old bug database.
I'm reporting this, as that testcase, likely the only one of its type was recently removed from the
testsuite, and the failure visibility that the test case brough, gone.
--
Summary: g++ doesn't reuse stack space
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mrs at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin6.3
GCC host triplet: powerpc-apple-darwin6.3
GCC target triplet: powerpc-apple-darwin6.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16269