This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Anonymous Namespaces
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: gcc at gcc dot gnu dot org, Kevin Atkinson <kevina at gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu dot integrable-solutions dot net>
- Date: 01 Feb 2004 06:17:32 +0100
- Subject: Re: Anonymous Namespaces
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0401312300170.10618-100000@nondot.org>
Chris Lattner <sabre@nondot.org> writes:
[...]
| I am perfectly willing to leave LLVM out of this. The whole point of me
| getting involved with the thread is to make GCC not do stupid things with
| an idiom that I commonly use. Specifically, you have shot this down as
| impossible in the past and I haven't said anything, so I figured that it
| would get shot down again unless I did. The fact that LLVM already
| performs these optimizations is secondary to the discussion.
I think your using "shot down" is descriptive how you think I view
this issue and the way the discussion went.
The least I can say is that that view is unfounded.
I'm not there to shot down optimizations. I'm specifically arguing
that
(1) whatever is done, the semantics of well-formed programs should not
be transmuted. And it was not clear to me that everybody
involved in the discussion had in the fore the interaction of
static vs. name lookup.
(2) anything is done should be done so with full knowledge of its
impact on the rest of language.
In order words, I prefer "sorry" to "oops".
What is impossible is saying any function in unnamed namespace is
declared static. The second thing is that what appears to be
static-specific optimizaation is not. It is often said that when your
tool is a hammer, everything starts looking like a nail. I don't want
us start turning everything into static just to be able to apply an
optimization which can be done under broader conditions, without
transmutation. It looks like we now have a plan to implement
something that is not disruptive.
[...]
| So, finally, to clear this mess up, do you acknowledge that this is
| possible to implement in GCC (and in fact, should not be hard)? Like
Yes, the optimization is possible without turning things into static.
-- Gaby