https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69471

--- Comment #10 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Sat Feb 23 19:39:35 2019
New Revision: 269164

URL: https://gcc.gnu.org/viewcvs?rev=269164&root=gcc&view=rev
Log:
driver: Also prune joined switches with negation

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.

Added:
    trunk/gcc/testsuite/gcc.dg/pr69471-1.c
    trunk/gcc/testsuite/gcc.dg/pr69471-2.c
    trunk/gcc/testsuite/gcc.target/i386/pr69471-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.opt
    trunk/gcc/doc/options.texi
    trunk/gcc/opts-common.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to