This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Lazy __FUNCTION__ processing.
- To: nathan at codesourcery dot com
- Subject: Re: Lazy __FUNCTION__ processing.
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 20 Apr 2001 10:21:56 -0700
- Cc: gcc-patches at gcc dot gnu dot org, zackw at stanford dot edu, pfeifer at dbai dot tuwien dot ac dot at
- Organization: CodeSourcery, LLC
- References: <3AE04B50.D25C1470@codesourcery.com>
Very cool. This is something I'd wanted to do for *ages*; I've
definitely measured the memory impact before, and noticed it was
large.
This is exactly the kind of thing that functions-as-trees enables, and
it's great to see people taking advantage of that infrastructure.
A few things about the patch:
- A bunch of functions need comments. (For example `fname_as_string').
- I'm not too happy about creating that new COMPOUND_STMT. IIRC,
there's something special about the first statement in a function.
(It get's special treatment for STMT_LINENO, or something like
that.) Instead, you could -- at the some point where we presently
create the declarations -- create a dummy DECL_STMT. If it's
not needed, zap it at the end of the function. If it is needed,
you have the perfect place to emit the new variables.
That would be a little less risky, I think.
I don't think we can put this patch on the branch at this point; it's
hard to argue that it fixes a critical bug, despite the major memory
savings.
It would be a good candidate for a 3.0.1 release, though.
Thanks!
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com