This is the mail archive of the 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: Results for g++ 3.1 application testing on i686-pc-linux-gnu

> I thought C++ allowed us to never emit these unless their 
> address is taken?  If that's the case, I'd consider this
> a (qoi) bug.

Well, for "C" there is always making -fno-common the default, if it 
wasn't const...


I'm not quite sure of C++ linkage rules for const ints. Jason's away, so 
perhaps somebody else can weigh in. To me, this seems to be clearly 
internal linkage, and thus able to be optimized.

>From 3.5, linkage:

    * When a name has internal linkage, the entity it denotes can be 
referred to by names from other scopes in the same translation unit.


    * an object or reference that is explicitly declared const and 
neither explicitly declared extern nor previously declared to have 
external linkage; or

Perhaps I'm missing something. 

FWIW, icc also does this, but it's not in read-only...

00000000 d i

So, who knows. If there is no clear consensus on this from the 
compiler-folk within a couple days, I think the thing to do is make the 
source code changes to enums so that application testing can proceed.

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