Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-18 Thread Richard Guenther
On Tue, Jan 17, 2012 at 5:22 PM, Jason Merrill wrote: > On 01/17/2012 09:51 AM, Richard Guenther wrote: >> >> Sure it works.  PCH is just a stage where LTO is not active yet. > > > That makes sense to me. Applied then. Richard. > Jason >

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Jason Merrill
On 01/17/2012 09:51 AM, Richard Guenther wrote: Sure it works. PCH is just a stage where LTO is not active yet. That makes sense to me. Jason

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Richard Guenther
On Tue, Jan 17, 2012 at 3:50 PM, Gabriel Dos Reis wrote: > On Tue, Jan 17, 2012 at 8:43 AM, Richard Guenther > wrote: > >>> I think we should issue a diagnostic about the combination of these >>> two flags.  Silent ignorance would lead to false user expectations >>> and supposed "bug" reports, if

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Gabriel Dos Reis
On Tue, Jan 17, 2012 at 8:43 AM, Richard Guenther wrote: >> I think we should issue a diagnostic about the combination of these >> two flags.  Silent ignorance would lead to false user expectations >> and supposed "bug" reports, if not confusion. > > I'm not sure what "expectation" there would be

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Richard Guenther
On Tue, Jan 17, 2012 at 2:23 PM, Diego Novillo wrote: > On Tue, Jan 17, 2012 at 04:35, Richard Guenther > wrote: > >> +  /* Disable LTO output when outputting a precompiled header.  */ >> +  if (pch_file && flag_lto) >> +    { >> +      flag_lto = 0; >> +      flag_generate_lto = 0; >> +    } >>

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Diego Novillo
On Tue, Jan 17, 2012 at 04:35, Richard Guenther wrote: > +  /* Disable LTO output when outputting a precompiled header.  */ > +  if (pch_file && flag_lto) > +    { > +      flag_lto = 0; > +      flag_generate_lto = 0; > +    } > + Emit a warning when you do this? Diego.

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Gabriel Dos Reis
On Tue, Jan 17, 2012 at 3:35 AM, Richard Guenther wrote: > On Mon, Jan 16, 2012 at 10:29 PM, Jason Merrill wrote: >> When outputting PCH/LTO, the compiler tries to generate mangled names for >> all decls before discarding language-specific data.  But that doesn't make >> sense for templates, and

Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-17 Thread Richard Guenther
On Mon, Jan 16, 2012 at 10:29 PM, Jason Merrill wrote: > When outputting PCH/LTO, the compiler tries to generate mangled names for > all decls before discarding language-specific data.  But that doesn't make > sense for templates, and leads to conflicts in this case. Fixed by refusing > to mangle

C++ PATCH for c++/51827 (mangling error with PCH and LTO)

2012-01-16 Thread Jason Merrill
When outputting PCH/LTO, the compiler tries to generate mangled names for all decls before discarding language-specific data. But that doesn't make sense for templates, and leads to conflicts in this case. Fixed by refusing to mangle templates. Tested x86_64-pc-linux-gnu, applying to trunk. c