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: Anonymous Namespaces


Chris Lattner <sabre@nondot.org> writes:

[...]

| > And replacing "being declared in an unnamed
| > space" with "being declared as static" (with static meaning what is
| > means in C and C++), changes the meaning of well-defined programs.
| 
| Which I understand and am _not suggesting_. 

So, exactly what are you suggesting with respect to the "unnamed
namespace" as far as GCC is concerned?  

| Please please please read my
| emails more carefully, or perhaps with more of an open mind.

If I was as open minded as you seem to imply, I would have said "Just
any bozo" and ignored your message.  Or is it essential for you to
believe that you're discussion something with less open minded people?

[...]

| > | > You're free to implement whatever you like in your research compiler.
| > |
| > | *sigh*, LLVM's goals are for it to be as stable and reliable as a
| > | commercial grade compiler, not for it to be "research quality".  Please do
| >
| > You're confused.  I did not say "research quality".  I said
| > "research compiler".
| 
| The implication was certainly there, otherwise why would you have included
| 'research'?

I would have said "only of academic interest", if I did imply insult.

| > | not sling insults unless you've _actually tried it out_.  Thanks.  In
| >
| > It is an insult in your mind only after you managed to read "reaserch
| > compiler" as "research quality".
| 
| Actually I read your comment exactly as you wrote it and followed the
| logical implication.  Coupled with your inflamatory "But of course,
| if the only thing you measure is speed and you rank it over
| correctness, you may not understand what I'm saying." comment, I don't
| think it is an unreasonable conclusion.

I guess you make the reasonable conclusion that makes you feel
reasonable; the value of auto-referential systems may be questionable :-/

| > | fact, I think if you did, you would find it optimizes C++ programs
| > | _substantially_ better than GCC does, and takes less time to do so.  Your
| > | example is just one case, there are many others.
| >
| > You're confused.  My example is not about how fast is the compiler,
| > rather how correct it is.  As I said, if the only thing you measure is
| > speed, then you may not get the point.
| 
| Again, I am not confused.  You seem to have ignored my statement that "in
| LLVM, we consider correctness the #1 concern".

I did not ignore it.

| We are _correct_, as is
| GCC.  The only difference is that GCC generates worse code, which I think
| is silly.  You never responded to my question about what kind of code GCC
| 3.4 generates for your example.

For the purpose of comparing apples and oranges?  How do you rewrite
the example I gave so that we can compare apples with apples and
oranges with oranges?  Because if

   Unlike the GCC tree representation, LLVM is not intended to follow any
   particular source-level language semantics (it is language-independent).
     
then the comparison is pointless.

| > | > And, I'm not advocating people generate pessimal code.  I'm telling
| > | > people that they should teach the inliner about unnamed namespaces
| > | > instead of transmuting meanings of well-defined codes.
| > |
| > | Again, as I said before, the inliner is not the only thing that cares,
| > | please read the examples I gave in my previous email.
| >
| > I did read them and even give a description of what you after (which
| > is not static).
| 
| And I tried to explain exactly why the transformation is safe, and have
| _demonstrated_ that it is for you.  What exactly do you need to be
| convinced?

I do not want you convince me of anything -- conviction is when religion
matters.  If you can't prove your transformation is correct as far as
C++ semantics is concerned, let's move on something different.  
I was wanting to make sure: 
  (1) we're talking of the same thing -- we don't, as you said your
      notion of internal linkage is not that of a program source level
      and at the same time you claim it is exactly like "static" in C++
      (which it can't be since that would lead to something different).

  (2) we're comparing oranges to oranges -- we don't, as you said your
      compiler follows no language semantic, whereas g++ ought to
      follow language semantics.

So, the question is what are you transforming according to what
semantics and what are you demonstrating?

|  Note _again_ that I have said _nothing_ about turning things
| in anonymous namespaces into 'static' objects!!

giving internal linkage to members of unnamed namespace was precisely 
the question of the original poster, that generated this traffic.

-- Gaby





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