summaryrefslogtreecommitdiff
path: root/docs/users_guide/using.xml
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-07-03 19:36:12 +0200
committerBen Gamari <ben@smart-cactus.org>2015-07-03 22:44:49 +0200
commit6400c7687223c5b2141176aa92f7ff987f61aba6 (patch)
tree1f4df8a45438f63fd9bdf4ac5ed6cd3afd0eb789 /docs/users_guide/using.xml
parentf07b7a876cb3b9d38bb7ed301503f5b84104fc90 (diff)
downloadhaskell-6400c7687223c5b2141176aa92f7ff987f61aba6.tar.gz
users_guide: Describe order-dependence of -f and -O flags
The behavior of the -f and -O options can be quite surprising. Document this fact. At some point this behavior should likely be changed. Test Plan: documentation only Reviewers: austin, trofi Reviewed By: austin, trofi Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1008 GHC Trac Issues: #10560
Diffstat (limited to 'docs/users_guide/using.xml')
-rw-r--r--docs/users_guide/using.xml23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 4d4b01f243..5642ea52c9 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -2105,6 +2105,29 @@ _ = rhs3 -- No warning: lone wild-card pattern
<emphasis>machine-specific</emphasis> optimisations to be turned
on/off.</para>
+ <para>Most of these options are boolean and have options to turn them both
+ &ldquo;on&rdquo; and &ldquo;off&rdquo; (beginning with the prefix
+ <option>no-</option>). For instance, while <option>-fspecialise</option>
+ enables specialisation, <option>-fno-specialise</option> disables it. When
+ multiple flags for the same option appear in the command-line they are
+ evaluated from left to right. For instance <option>-fno-specialise
+ -fspecialise</option> will enable specialisation.
+ </para>
+
+ <para>It is important to note that the <option>-O*</option> flags are roughly
+ equivalent to combinations of <option>-f*</option> flags. For this reason,
+ the effect of the <option>-O*</option> and <option>-f*</option> flags is
+ dependent upon the order in which they occur on the command line.
+ </para>
+
+ <para>For instance, take the example of <option>-fno-specialise
+ -O1</option>. Despite the <option>-fno-specialise</option> appearing in the
+ command line, specialisation will still be enabled. This is the case
+ as <option>-O1</option> implies <option>-fspecialise</option>, overriding
+ the previous flag. By contrast, <option>-O1 -fno-specialise</option> will
+ compile without specialisation, as one would expect.
+ </para>
+
<sect2 id="optimise-pkgs">
<title><option>-O*</option>: convenient &ldquo;packages&rdquo; of optimisation flags.</title>