public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ?
       [not found] ` <alpine.DEB.2.02.1108211241070.2592@laptop-mg.saclay.inria.fr>
@ 2011-08-21 12:09   ` Emmanuel Fleury
  2011-08-21 12:20     ` Marc Glisse
  0 siblings, 1 reply; 5+ messages in thread
From: Emmanuel Fleury @ 2011-08-21 12:09 UTC (permalink / raw)
  To: gcc-help; +Cc: gcc

Hi,

On 08/21/2011 12:48 PM, Marc Glisse wrote:
> Wrong mailing list, you are looking for gcc-help.

Ok, sorry for that.

But, I looked thoroughly to the kyua code and I didn't see anything 
wrong (even if I might have missed something, I admit it. I'm not a C++ 
god).

In fact, after a quick look at the g++-4.6 changelog, I found the 
following item:

« * When an extern declaration within a function does not match a 
declaration in the enclosing context, G++ now properly declares the name 
within the namespace of the function rather than the namespace which was 
open just before the function definition (c++/43145). »

See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43145

My work hypothesis for now is that the fix of this issue has changed 
something in the way namespaces are handled

I think this issue is related to this change and that a bug has been 
introduced in the compiler when c++/43145 has been fixed.

But, this is only an hypothesis.

>  From the code. The definition (not just declaration) of templates
> should be available everywhere they are used (or you can manually force
> instantiation in one translation unit and inhibit it in the others).

And, could you spot the change that occurred in g++ between g++-4.5 and 
g++-4.6 that changed its behavior ?

Why was it possible before and not anymore now ?

>> (sorry I didn't manage to circumvent the problem to a small piece of
>> code),
>
> Er, what did you try?

I am currently trying to do so and I didn't succeed to better understand 
the problem by now.

My guess is that it is related to the namespace handling and I am 
working in this direction. But, I have no more to say (except my 
intuition that it might be related) and the code of kyua is new to me, 
so it does take some time.

Regards
-- 
Emmanuel Fleury

If you can not measure it, you can not improve it.
   -- Lord Kelvin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ?
  2011-08-21 12:09   ` Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ? Emmanuel Fleury
@ 2011-08-21 12:20     ` Marc Glisse
  2011-08-21 12:23       ` Marc Glisse
  2011-08-21 13:07       ` Emmanuel Fleury
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Glisse @ 2011-08-21 12:20 UTC (permalink / raw)
  To: Emmanuel Fleury; +Cc: gcc-help

On Sun, 21 Aug 2011, Emmanuel Fleury wrote:

> But, I looked thoroughly to the kyua code and I didn't see anything wrong 
> (even if I might have missed something, I admit it. I'm not a C++ god).

Adding #include "cli/common.ipp" to cli/cmd_test_test.cpp, 
cli/cmd_config_test.cpp and cli/cmd_about_test.cpp helps. Those files call 
a template function whose definition is not available.

> And, could you spot the change that occurred in g++ between g++-4.5 and 
> g++-4.6 that changed its behavior ?

Not sure. Maybe the inliner is more aggressive?

> Why was it possible before and not anymore now ?

g++ used to leave an instantiation lying around, which it doesn't anymore.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ?
  2011-08-21 12:20     ` Marc Glisse
@ 2011-08-21 12:23       ` Marc Glisse
  2011-08-21 13:08         ` Emmanuel Fleury
  2011-08-21 13:07       ` Emmanuel Fleury
  1 sibling, 1 reply; 5+ messages in thread
From: Marc Glisse @ 2011-08-21 12:23 UTC (permalink / raw)
  To: gcc-help; +Cc: Emmanuel Fleury

On Sun, 21 Aug 2011, Marc Glisse wrote:
> On Sun, 21 Aug 2011, Emmanuel Fleury wrote:
>> And, could you spot the change that occurred in g++ between g++-4.5 and 
>> g++-4.6 that changed its behavior ?
>
> Not sure. Maybe the inliner is more aggressive?

Or maybe this one:
"C++ inline functions and virtual tables are now privatized more 
aggressively, leading to better inter-procedural optimization and faster 
dynamic linking."

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ?
  2011-08-21 12:20     ` Marc Glisse
  2011-08-21 12:23       ` Marc Glisse
@ 2011-08-21 13:07       ` Emmanuel Fleury
  1 sibling, 0 replies; 5+ messages in thread
From: Emmanuel Fleury @ 2011-08-21 13:07 UTC (permalink / raw)
  To: gcc-help; +Cc: Marc Glisse

Hi,

On 08/21/2011 02:20 PM, Marc Glisse wrote:
> On Sun, 21 Aug 2011, Emmanuel Fleury wrote:
>
>> But, I looked thoroughly to the kyua code and I didn't see anything
>> wrong (even if I might have missed something, I admit it. I'm not a
>> C++ god).
>
> Adding #include "cli/common.ipp" to cli/cmd_test_test.cpp,
> cli/cmd_config_test.cpp and cli/cmd_about_test.cpp helps. Those files
> call a template function whose definition is not available.

Indeed, this solved the issue.

Thanks a lot.

Regards
-- 
Emmanuel Fleury

A well-written program is its own heaven; a poorly-written program is
its own hell.
   -- Geoffrey James (Book 4, Coding, The Tao of Programming)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ?
  2011-08-21 12:23       ` Marc Glisse
@ 2011-08-21 13:08         ` Emmanuel Fleury
  0 siblings, 0 replies; 5+ messages in thread
From: Emmanuel Fleury @ 2011-08-21 13:08 UTC (permalink / raw)
  To: gcc-help; +Cc: Marc Glisse

On 08/21/2011 02:23 PM, Marc Glisse wrote:
>
> Or maybe this one:
> "C++ inline functions and virtual tables are now privatized more
> aggressively, leading to better inter-procedural optimization and faster
> dynamic linking."

Ah, very likely !

Thanks a lot for the help and sorry for the noise.

Regards
-- 
Emmanuel Fleury

Rule 7: Use shell scripts to increase leverage and portability.
   -- Mike Gancarz (The UNIX Philosophy)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-21 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4E50D56F.1070806@labri.fr>
     [not found] ` <alpine.DEB.2.02.1108211241070.2592@laptop-mg.saclay.inria.fr>
2011-08-21 12:09   ` Critical behavioral change between g++-4.4/g++-4.5 and g++-4.6 ? Emmanuel Fleury
2011-08-21 12:20     ` Marc Glisse
2011-08-21 12:23       ` Marc Glisse
2011-08-21 13:08         ` Emmanuel Fleury
2011-08-21 13:07       ` Emmanuel Fleury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).