Re: make_decl_one_only and inlining

2013-02-18 Thread Johannes Pfau
Jan Hubicka ucw.cz> writes: > > > > How does the C++ frontend handle this? > > See logic in cgraph_function_body_availability. When function is weak (that is effect > of make_decl_one_only) it will be inlinable only if it is declared inline. This happens > to be the case of C++ weaks because o

Re: make_decl_one_only and inlining

2013-02-17 Thread Jan Hubicka
> >> Set DECL_COMDAT. You said that didn't work but you didn't fully > >> explain why. A DECL_COMDAT function should be output in every object > >> file in which it is referenced. > > > > I wasn't sure if that's the correct approach. If it is, some > > further investigation will be necessary why

Re: make_decl_one_only and inlining

2013-02-17 Thread Jan Hubicka
> Hi, > > We recently got a bug report for the GCC D compiler frontend which shows that > we > currently don't inline any templated functions. The reason seems to be that > decl_replaceable_p always returns true for D template functions. > > We currently just mark such template function instance

Re: make_decl_one_only and inlining

2013-02-16 Thread Ian Lance Taylor
On Sat, Feb 16, 2013 at 12:00 AM, Johannes Pfau wrote: > Ian Lance Taylor google.com> writes: > >> >> Why is that? decl_replaceable_p is supposed to be true for a function >> that may be replaced by an entirely different function at runtime. >> This is mainly to implement the correct semantics f

Re: make_decl_one_only and inlining

2013-02-16 Thread Johannes Pfau
Ian Lance Taylor google.com> writes: > > Why is that? decl_replaceable_p is supposed to be true for a function > that may be replaced by an entirely different function at runtime. > This is mainly to implement the correct semantics for weak functions. > You can't inline a weak function, but at

Re: make_decl_one_only and inlining

2013-02-15 Thread Ian Lance Taylor
On Fri, Feb 15, 2013 at 9:57 AM, Johannes Pfau wrote: > > We recently got a bug report for the GCC D compiler frontend which shows that > we > currently don't inline any templated functions. The reason seems to be that > decl_replaceable_p always returns true for D template functions. Why is tha

make_decl_one_only and inlining

2013-02-15 Thread Johannes Pfau
Hi, We recently got a bug report for the GCC D compiler frontend which shows that we currently don't inline any templated functions. The reason seems to be that decl_replaceable_p always returns true for D template functions. We currently just mark such template function instances using make_decl