This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix LTO option streaming
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Apr 2015 21:32:45 +0200
- Subject: Re: [PATCH] Fix LTO option streaming
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1504231403230 dot 20496 at zhemvz dot fhfr dot qr> <20150423151619 dot GD79833 at kam dot mff dot cuni dot cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Apr 23, 2015 at 05:16:19PM +0200, Jan Hubicka wrote:
> > the target option side (for SWITCHABLE_TARGET). Do not record
> > any target options in the lto_opts section.
> >
> > Honza - I suppose we don't have any testcase that this works, I'll
> > try to come up with sth. This also looks like a correctness issue
> > to me.
>
> Thanks, that would be a good idea. So with SWITCHABLE_TARGET
> we have problem that after switching the options are misinterpretted?
> I think Jakub made patch to simply skip target-option-node streaming here,
> how this is supposed to work.
> >
> > We can do similar changes for optimize options, now, for all targets, no?
>
> I am not quite sure about this; not all options are per-function nature.
> I need to audit all the target options for LTO safety, I did some work
> on this for optimization options, but the target options are still very wild.
> For example I am not quite convinced mixing -malign-double -mno-align-double units
> will work as expected.
SWITCHABLE_TARGETs are 3, i?86/x86_64, powerpc* and mips*, but mips*
does not support target attribute (and no other targets do).
Also, not all options are allowed in target attribute, doesn't the option
need to be Target and Save, I think not all CL_TARGET options are Save.
> > Index: gcc/lto-opts.c
> > ===================================================================
> > *** gcc/lto-opts.c (revision 222360)
> > --- gcc/lto-opts.c (working copy)
> > *************** lto_write_options (void)
> > *** 219,224 ****
> > --- 219,230 ----
> > && lto_stream_offload_p)
> > continue;
> >
> > + /* Do not store target-specific options if we target a
> > + SWITCHABLE_TARGET target. */
> > + if ((cl_options[option->opt_index].flags & CL_TARGET)
> > + && SWITCHABLE_TARGET)
> > + continue;
> > +
> > /* Drop options created from the gcc driver that will be rejected
> > when passed on to the driver again. */
> > if (cl_options[option->opt_index].cl_reject_driver)
Jakub