aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2019-02-23 19:39:35 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2019-02-23 11:39:35 -0800
commitaebe10d48ccc217273ee8a4e2c3805ed1e173a78 (patch)
tree8adfb00f7eaa823c09b2fa514cf58c21740af52b /gcc/doc
parent85627e2a9e9808c49da92b943a3c8e22106bf9aa (diff)
downloadgcc-aebe10d48ccc217273ee8a4e2c3805ed1e173a78.zip
gcc-aebe10d48ccc217273ee8a4e2c3805ed1e173a78.tar.gz
gcc-aebe10d48ccc217273ee8a4e2c3805ed1e173a78.tar.bz2
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. From-SVN: r269164
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/options.texi6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi
index 0081243..1c83d24 100644
--- a/gcc/doc/options.texi
+++ b/gcc/doc/options.texi
@@ -220,7 +220,11 @@ property is used.
The option will turn off another option @var{othername}, which is
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.