On Thu, Feb 14, 2019 at 5:51 AM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> On Thu, Feb 14, 2019 at 12:03:30PM +0100, Jakub Jelinek wrote:
> > On Wed, Feb 13, 2019 at 06:27:51PM -0800, H.J. Lu wrote:
> > > --- a/gcc/doc/options.texi
> > > +++ b/gcc/doc/options.texi
> > > @@ -227,7 +227,10 @@ options, their @code{Negative} properties should 
> > > form a circular chain.
> > >  For example, if options @option{-@var{a}}, @option{-@var{b}} and
> > >  @option{-@var{c}} are mutually exclusive, their respective 
> > > @code{Negative}
> > >  properties should be @samp{Negative(@var{b})}, @samp{Negative(@var{c})}
> > > -and @samp{Negative(@var{a})}.
> > > +and @samp{Negative(@var{a})}.  @code{Negative} can be used together
> > > +with @code{Joined} if there is no @code{RejectNegative} property.
> > > +@code{Negative} is ignored if there is @code{Joined} without
> > > +@code{RejectNegative}.
> >
> > I think this doesn't describe what is implemented.
> >
> > Something like:
> >  the option name with the leading ``-'' removed.  This chain action will
> >  propagate through the @code{Negative} property of the option to be
> > -turned off.
> > +turned off.  The driver will prune options, removing those that are
> > +turned off by some later option.  This pruning is not done for options
> > +with @code{Joined} or @code{JoinedOrMissing} properties, unless the
> > +options have either @code{RejectNegative} property or the @code{Negative}
> > +property mentions an option other than itself.
> >
> >  As a consequence, if you have a group of mutually-exclusive
> >  options, their @code{Negative} properties should form a circular chain.
> >
> > ?
> >
> > Otherwise LGTM, but Joseph is the options machinery maintainer, so I'll
> > defer to him here.
> >
>
> Here is the updated patch with a "-march=native -march=knl" testcase.
>
> Thanks.
>
> H.J.
> ---
> When -march=native is passed to host_detect_local_cpu to the backend,
> it overrides all command lines after it.  That means
>
> $ gcc -march=native -march=skylake-avx512
>
> is the treated as
>
> $ gcc -march=skylake-avx512 -march=native
>
> Prune joined switches with Negative and RejectNegative to allow
> -march=skylake-avx512 to override previous -march=native on command-line.
>
> gcc/
>
>         PR driver/69471
>         * opts-common.c (prune_options): Also prune joined switches
>         with Negative and RejectNegative.
>         * config/i386/i386.opt (march=): Add Negative(march=).
>         (mtune=): Add Negative(mtune=).
>         * doc/options.texi: Document Negative used together with Joined
>         and RejectNegative.
>
> gcc/testsuite/
>
>         PR driver/69471
>         * gcc.dg/pr69471-1.c: New test.
>         * gcc.dg/pr69471-2.c: Likewise.
>         * gcc.target/i386/pr69471-3.c: Likewise.

PING:

https://gcc.gnu.org/ml/gcc-patches/2019-02/msg01071.html


-- 
H.J.

Reply via email to